InMemoryTransport.subscribe
- InMemoryTransport.subscribe(topic, callback)[source]
Subscribe to a topic.
Every time a new message is received on the topic, the callback will be invoked.
- Parameters:
- topic
Topic
Instance of the topic to subscribe to.
- callbackfunction
Callback to invoke whenever a new message arrives. The callback should receive only one msg argument, e.g.
lambda msg: print(msg)
.
- topic
- Returns:
- str
Returns an identifier of the subscription.