InMemoryTransport
- class compas_eve.InMemoryTransport[source]
Bases:
Transport,EventEmitterMixinIn-Memory transport is ideal for simple single-process apps and testing.
It will only distribute messages within the same process, not across different processes.
- Parameters:
- codec
MessageCodec, optional The codec to use for encoding and decoding messages. If not provided, defaults to
JsonMessageCodec.
- codec
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*argsand**kwargsto each attached function.Returns a list of all listeners registered to the
event.Removes the function
ffromevent.Registers the function (or optionally an asyncio coroutine function)
fto 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
ffromevent.