happyly.listening.listener.ExecutorWithAck

class happyly.listening.listener.ExecutorWithAck(subscriber, handler, deserializer, serializer=<happyly.serialization.dummy.DummySerde object>, publisher=None)

Bases: happyly.listening.executor.Executor, typing.Generic

Acknowledge-aware listener. Defines ListenerWithAck.ack() method. Subclass ListenerWithAck and specify when to ack by overriding the corresponding callbacks.

ack(message)

Acknowledge the message using implementation from subscriber, then log success.

on_acknowledged(message)

Callback which is called write after message was acknowledged.

on_acknowledged(message)

Callback which is called write after message was acknowledged.

Override it in your custom Executor/Listener if needed, but don’t forget to call implementation from base class.

Parameters

message (Any) – Message as it has been received, without any deserialization

ack(message)

Acknowledge the message using implementation from subscriber, then log success.

Parameters

message (Any) – Message as it has been received, without any deserialization