traits_futures.qt.message_router module

Message routing for the Qt toolkit.

class traits_futures.qt.message_router.MessageReceiver[source]

Bases: traits.has_traits.HasStrictTraits

Main-thread object that receives messages from a MessageSender.

done = Event()

Event fired to indicate that the sender has sent its last message.

message = Event(Any())

Event fired when a message is received from the paired sender.

class traits_futures.qt.message_router.MessageRouter[source]

Bases: traits.has_traits.HasStrictTraits

Router for messages, sent by means of Qt signals and slots.

Requires the event loop to be running in order for messages to arrive.


Create a (sender, receiver) pair for sending messages.

  • sender (MessageSender) – Object to be passed to the background task to send messages.
  • receiver (MessageReceiver) – Object to be kept in the foreground which reacts to messages.
class traits_futures.qt.message_router.MessageSender(connection_id, signallee, message_queue)[source]

Bases: object

Object allowing the worker to send messages.

This class will be instantiated in the main thread, but passed to the worker thread to allow the worker to communicate back to the main thread.

Only the worker thread should use the send method, and only inside a “with sender:” block.


Send a message to the router.

Previous topic

traits_futures.qt.init module

Next topic

traits_futures.api module

This Page