Factory#

class mobu.factory.Factory(context, logger=None)#

Bases: object

Component factory for mobu.

Uses the contents of a ProcessContext to construct the components of an application on demand.

Parameters:

Methods Summary

create_slack_webhook_client()

Create a Slack webhook client if configured for Slack alerting.

create_solitary(solitary_config)

Create a runner for a solitary monkey.

set_logger(logger)

Replace the internal logger.

Methods Documentation

create_slack_webhook_client()#

Create a Slack webhook client if configured for Slack alerting.

Returns:

Newly-created Slack client, or None if Slack alerting is not configured.

Return type:

safir.slack.webhook.SlackWebhookClient or None

create_solitary(solitary_config)#

Create a runner for a solitary monkey.

Parameters:

solitary_config (SolitaryConfig) – Configuration for the solitary monkey.

Returns:

Newly-created solitary manager.

Return type:

Solitary

set_logger(logger)#

Replace the internal logger.

Used by the context dependency to update the logger for all newly-created components when it’s rebound with additional context.

Parameters:

logger (BoundLogger) – New logger.

Return type:

None