Api
Core Module
Core dispatch mechanism.
Dispatcher(maxsize=0)
Message dispatcher.
The dispatcher carries out the following steps:
- Receive and enqueue messages.
- Dequeue one message.
- Determine
reactmethod. - Collect messages from running
reactmethod. - Repeat or exit.
Parameters:
-
maxsize(int, default:0) –passed to queue
Initialize the dispatcher.
Source code in rsvp/core.py
24 25 26 27 | |
dispatch(message)
async
Dispatch a single message.
Parameters:
-
message(Message) –the message for dispatch.
Source code in rsvp/core.py
29 30 31 32 33 34 35 36 37 38 | |
dispose(receiver, args)
async
Dispose a message without react method.
Feel free to override this method in order to change behavior.
Parameters:
-
receiver(object) –the receiver of the message
-
args(Sequence[object]) –the message arguments.
Source code in rsvp/core.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |
receive(message)
async
Receive and enqueue a single message.
Parameters:
-
message(Message) –the received message.
Source code in rsvp/core.py
71 72 73 74 75 76 | |
start()
Start the dispatcher loop as a new task.
If this dispatcher has already a loop running this method does nothing.
Returns:
-
bool–whether a new loop was started
Source code in rsvp/core.py
93 94 95 96 97 98 99 100 101 102 103 104 105 | |
handler: python