cyme.models

cyme.models

class cyme.models.Broker(*args, **kwargs)

Broker connection arguments.

url

AMQP (kombu) url.

connection()

Return a new Connection to this broker.

as_dict()

Returns this broker as a dictionary that can be Json encoded.

pool

A connection pool with connections to this broker.

objects

The manager for this model is BrokerManager.

class cyme.models.Queue(*args, **kwargs)

An AMQP queue that can be consumed from by one or more instances.

name

Queue name (unique, max length 128)

exchange

Exchange name (max length 128)

exchange_type

Exchange type (max length 128)

routing_key

Routing key/binding key (max length 128).

options

Additional JSON encoded queue/exchange/binding options. see kombu.compat for a list of options supported.

is_enabled

Not in use.

created_at

Timestamp created.

as_dict()

Returns dictionary representation of this queue that can be Json encoded.

objects

The manager for this model is QueueManager.

class cyme.models.Instance(*args, **kwargs)

A celeryd instance.

name

Name of the instance.

queues

Queues this instance should consume from (many to many relation to Queue).

max_concurrency

Autoscale setting for max concurrency. (maximum number of processes/threads/green threads when the worker is active).

min_concurrency

Autoscale setting for min concurrency. (minimum number of processes/threads/green threads when the worker is idle).

is_enabled

Flag set if this instance should be running.

created_at

Timestamp of when this instance was first created.

broker

The broker this instance should connect to. (foreign key to Broker).

Broker

Broker model class used (default is Broker)

Queue

Queue model class used (default is Queue)

MultiTool

Class used to start/stop and restart celeryd instances. (Default is celery.bin.celeryd_multi.MultiTool).

objects

The manager used for this model is InstanceManager.

cwd

Working directory used by all instances. (Default is /var/run/cyme).

as_dict()

Returns dictionary representation of this instance that can be Json encoded.

enable()

Enables this instance (model-only).

disable()

Disables this instance (model-only).

start(**kwargs)

Starts the instance.

stop(**kwargs)

Shuts down the instance.

restart(**kwargs)

Restarts the instance.

alive(**kwargs)

Returns True if the pid responds to signals, and the instance responds to ping broadcasts.

stats(**kwargs)

Returns instance statistics (like celeryctl inspect stats).

autoscale(max=None, min=None, **kwargs)

Set max/min autoscale settings.

responds_to_ping(**kwargs)

Returns True if the instance responds to broadcast ping.

responds_to_signal()

Returns True if the pid file exists and the pid responds to signals.

consuming_from(**kwargs)

Returns the queues the instance is currently consuming from.

add_queue(q, **kwargs)

Add queue for this instance by name.

cancel_queue(queue, **kwargs)

Cancel queue for this instance by Queue.

getpid()

Get the process id for this instance by reading its pid file.

Returns None if the pid file does not exist.

_action(action, multi='celeryd-multi')

Execute celeryd-multi command.

_query(cmd, args={}, **kwargs)

Send remote control command and wait for this instances reply.

Previous topic

cyme.api.web

Next topic

cyme.models.managers

This Page