shellbot.updaters.queue module

class shellbot.updaters.queue.QueueUpdater(engine=None, **kwargs)[source]

Bases: shellbot.updaters.base.Updater

Writes inbound events to a queue

This updater serializes events and write them to a queue.

An event may be a Message, a Join or Leave notification, or any other Event.

Updaters expose a filtering function that can be connected to the inbound flow of events handled by the Listener.

Example:

updater = QueueUpdater(queue=Queue())
listener = Listener(filter=updater.filter)

Of course, some process has to grab content from updater.queue afterwards.

on_init(queue=None, **kwargs)[source]

Writes inbound events to a queue

put(event)[source]

Processes one event

Parameters:event (Event or Message or Join or Leave) – inbound event

This function serializes the event and write it to a queue.