InMemoryTransport
- class compas_eve.memory.InMemoryTransport[source]
Bases:
Transport
,EventEmitterMixin
In-Memory transport is ideal for simple single-process apps and testing.
It will only distribute messages within the same process, not across different processes.
Methods
Announce this code will publish messages to the specified topic.
In-memory transport is always ready, it will immediately trigger the callback.
Publish a message to a topic.
Subscribe to a topic.
Announce that this code will stop publishing messages to the specified topic.
Unsubscribe from the specified topic.
Unsubscribe from the specified topic based on the subscription id.
Inherited Methods
Emit
event
, passing*args
and**kwargs
to each attached function.Returns a list of all listeners registered to the
event
.Removes the function
f
fromevent
.Registers the function (or optionally an asyncio coroutine function)
f
to the event nameevent
.The same as
ee.on
, except that the listener is automatically removed after being called.Remove all listeners attached to
event
.Removes the function
f
fromevent
.