m4us.core.utils

Provides common utilities for the rest of the project.

Members

Return links connecting the coroutines in the standard way.

The given coroutines are linked in a pipeline (not to be confused with a Pipeline) of outbox to inbox and signal to control mailboxes. The first coroutine will only have it's outbox and signal mailboxes linked and the last coroutine will only have it's inbox and control mailboxes linked. Coroutines in the middle will be linked to the previous and next coroutines in order.

The resulting links can then be passed to a post office.

Parameters:
Returns:

A set of mailbox links to be given to a post office.

Return type:

set

Note

Normally one would just use the Pipeline class, but this provides just the links, which could be useful to other container classes.

See also

The IPostOffice interface for more information on links, mailboxes and post offices.

See also

The Pipeline class for the normal way to construct coroutine pipelines.

is_shutdown(inbox, message, expected_inbox=u'control')[source]

Return True if the given message signals a shutdown.

Coroutines are expected to shutdown when they receive a shutdown message. This is a convenience function that returns True if inbox is control (by default) and the message object provides or is adaptable to IShutdown.

Parameters:
Returns:

True if the message signals that the coroutine should shutdown, False otherwise.

Return type:

bool

Table Of Contents

Previous topic

m4us.core.schedulers

Next topic

Appendix A: Full Licence Text

This Page