Contents
anyblok_dramatiq.actor.AnyBlokActorExceptionBases: ValueError
A ValueError exception for anyblok_dramatiq
with_traceback()Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
anyblok_dramatiq.actor.AnyBlokActor(fn, *, broker, actor_name, queue_name, priority, options)Bases: dramatiq.actor.Actor
Overload the dramatiq.actor.Actor class
the goal is to allowthe decorator actor_send, this decorator use directly the method send
send(*args, **kwargs)Send to the broker
anyblok_dramatiq.actor.declare_actor_for(method, **kwargs)Method to add anyblok_dramatiq.actor.actor decorator on the class method
| Parameters: |
|
|---|
anyblok_dramatiq.actor.declare_actor_send_for(method, **kwargs)Method to add anyblok_dramatiq.actor.actor_send decorator on the class method
| Parameters: |
|
|---|
anyblok_dramatiq.actor.actor(queue_name='default', priority=0, **options)Decorator to get an Actor
| Parameters: |
|
|---|
anyblok_dramatiq.actor.actor_send(queue_name='default', priority=0, **options)Decorator to get an AnyBlokActor
| Parameters: |
|
|---|
anyblok_dramatiq.actor.call_directly_the_actor_send()Context manager to call directly without use dramatiq
anyblok_dramatiq.actor.ActorPlugin(registry)Bases: anyblok.model.plugins.ModelPluginBase
anyblok.model.plugin to allow the build of the
anyblok_dramatiq.actor
after_model_construction(base, namespace, transformation_properties)Do some action with the constructed Model
| Parameters: |
|
|---|
initialisation_tranformation_properties(properties, transformation_properties)Initialise the transform properties
| Parameters: |
|
|---|
insert_in_bases(new_base, namespace, properties, transformation_properties)Insert in a base the overload
| Parameters: |
|
|---|
transform_base_attribute(attr, method, namespace, base, transformation_properties, new_type_properties)transform the attribute for the final Model
| Parameters: |
|
|---|
anyblok_dramatiq.actor.ActorSendPlugin(registry)Bases: anyblok.model.plugins.ModelPluginBase
anyblok.model.plugin to allow the build of the
anyblok_dramatiq.actor_send
after_model_construction(base, namespace, transformation_properties)Do some action with the constructed Model
| Parameters: |
|
|---|
initialisation_tranformation_properties(properties, transformation_properties)Initialise the transform properties
| Parameters: |
|
|---|
insert_in_bases(new_base, namespace, properties, transformation_properties)Insert in a base the overload
| Parameters: |
|
|---|
transform_base_attribute(attr, method, namespace, base, transformation_properties, new_type_properties)transform the attribute for the final Model
| Parameters: |
|
|---|
anyblok_dramatiq.broker.prepare_broker(withmiddleware=True)Configure the broker for send and workers
anyblok_dramatiq.middleware.DramatiqMessageMiddlewareBases: dramatiq.middleware.middleware.Middleware
Middleware for dramatiq, the goal is to detect if the the call
was done by anyblok tools with the Model.Dramatiq.Message. This
model stock the status of the message and the history of the status’s
change
after_process_message(broker, message, *, result=None, exception=None)Called after process message
If the message is in the Model.Dramatiq.Message then
the status will be change to done or failed.
Note
the status is failed if an exception is passed or a rollback is need
Before the end, the session is expired to release the Session pool thread
| Parameters: |
|
|---|
after_skip_message(broker, message)Called after skip message
If the message is in the Model.Dramatiq.Message then
the status will be change to skip
Before the end, the session is expired to release the Session pool thread
| Parameters: |
|
|---|
after_worker_shutdown(*args, **kwargs)Called before worker shutdown
Close the AnyBlok registry
before_consumer_thread_shutdown(*args, **kwargs)Called before consumer thread shutdown
remove the session instance to clean the Session pool
before_enqueue(broker, message, delay)Called when a message is delayed or enqueued
If the message is in the Model.Dramatiq.Message then
the status will be change to delayed or enqueued
| Parameters: |
|
|---|
before_process_message(broker, message)Called before process message
Invalid the cache, this is mean that if a cache have to be invalidated then it will be invalidated else nothing is done
If the message is in the Model.Dramatiq.Message then
the status will be change to running
| Parameters: |
|
|---|
before_worker_thread_shutdown(*args, **kwargs)Called before worker thread shutdown
remove the session instance to clean the Session pool