Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Method and system for distributing event through event bus

An event bus and event technology, which is applied in inter-program communication, instruments, multi-channel program devices, etc., can solve the problems of slow event distribution and processing speed, inconvenient use, etc., and achieve the effect of simple use and clear logic

Active Publication Date: 2017-04-26
WUHAN DOUYU NETWORK TECH CO LTD
View PDF3 Cites 11 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0007] The technical problem to be solved by the present invention is to provide an easy-to-use and clear logic for the defects of slow event distribution and processing speed or inconvenient use in the prior art, so that developers can pay more attention to business logic and do not need to worry about event processing. A method and system for distributing events through an event bus that consumes a corresponding amount of time

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and system for distributing event through event bus
  • Method and system for distributing event through event bus
  • Method and system for distributing event through event bus

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0049] In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

[0050] The terms involved in the present invention are explained as follows:

[0051] Handler: Handler is mainly used for asynchronous message processing: when a message is sent, it first enters a message queue, and the function of sending the message returns immediately, while the other part takes out the messages one by one in the message queue, and then processes the message, also That is, sending and receiving messages are not synchronized. This mechanism is usually used to handle relatively long operations.

[0052]Class: Class is a concept in object-oriented programming and the basis of obj...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention provides a method and a system for distributing an event through an event bus. The method comprises the steps that an event publisher publishes the event; the event bus analyzes the published event to obtain event parameters, and an event handling function set classified in advance and corresponding to the event is acquired according to the event parameters, wherein the event handling function set contains all event handling functions for handling the event, and each event handling function corresponds to one event subscriber; the event handling functions in the event handling function set are executed, and the event is distributed to the event subscribers. The complete event communication bus is provided, a corresponding event request can be well distributed, the method and the system are easy to use, logic is clear, and a developer can pay more attention to service logic without spending corresponding time distributing the event.

Description

technical field [0001] The invention relates to the communication field of an Android system, in particular to a method and system for distributing events through an event bus. Background technique [0002] There are usually multiple interfaces and multiple functional modules in an Android application program. There are usually the following solutions in Android to deal with communication problems between interfaces or functional modules. [0003] One is to use Handler to communicate between multiple threads, which is relatively convenient to use, but it is easy to cause problems such as memory leaks. Secondly, if the Handler is passed and used in multiple interfaces, it will be more complicated, which greatly increases the coupling between modules. It makes the program more complicated, and it is very difficult to maintain later. [0004] The second is to communicate between components through broadcasting. Broadcasting is a relatively common technology in the Android sy...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/54
CPCG06F9/542G06F2209/546
Inventor 张磊
Owner WUHAN DOUYU NETWORK TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products