Monkey#

class mobu.services.monkey.Monkey(*, name, flock=None, business_config, user, discovery_client, http_client, events, repo_manager, logger)#

Bases: object

Runs one business and manages its log and configuration.

Parameters:

Methods Summary

alert(exc)

Send an exception to Sentry.

dump()

Return information about a running monkey.

logfile()

Get the log file for a monkey's log.

run_once()

Run the monkey business once.

signal_refresh()

Tell the business to refresh.

start(scheduler)

Start the monkey.

stop()

Stop the monkey.

Methods Documentation

async alert(exc)#

Send an exception to Sentry.

Parameters:

exc (Exception) – Exception prompting the alert.

Return type:

None

dump()#

Return information about a running monkey.

Return type:

MonkeyData

logfile()#

Get the log file for a monkey’s log.

Return type:

str

async run_once()#

Run the monkey business once.

Returns:

Error message on failure, or None if the business succeeded.

Return type:

str or None

signal_refresh()#

Tell the business to refresh.

Return type:

None

async start(scheduler)#

Start the monkey.

Parameters:

scheduler (Scheduler)

Return type:

None

async stop()#

Stop the monkey.

Return type:

None