NSQ.Message (elixir_nsq v1.2.0)
Summary
Functions
Returns a specification to start this module under a supervisor.
Tells NSQD that we're done processing this message. This is called automatically when the handler returns successfully, or when all retries have been exhausted.
Given a raw NSQ message with frame_type = message, return a struct with its parsed data.
Callback implementation for GenServer.init/1
.
This is the main entry point when processing a message. It starts the message GenServer and immediately kicks of a processing call.
Tells NSQD to requeue the message, with delay and backoff. According to the go-nsq client (but doc'ed nowhere), a delay of -1 is a special value that means nsqd will calculate the duration itself based on the default requeue timeout. If backoff=true is set, then the connection will go into "backoff" mode, where it stops receiving messages for a fixed duration.
This function is intended to be used by the handler for long-running functions. They can set up a separate process that periodically touches the message until the process finishes.
Functions
child_spec(init_arg)
Returns a specification to start this module under a supervisor.
See Supervisor
.
fin(message)
Tells NSQD that we're done processing this message. This is called automatically when the handler returns successfully, or when all retries have been exhausted.
from_data(data)
Given a raw NSQ message with frame_type = message, return a struct with its parsed data.
init(message)
Callback implementation for GenServer.init/1
.
process(message)
This is the main entry point when processing a message. It starts the message GenServer and immediately kicks of a processing call.
req(message, delay \\ -1, backoff \\ false)
Tells NSQD to requeue the message, with delay and backoff. According to the go-nsq client (but doc'ed nowhere), a delay of -1 is a special value that means nsqd will calculate the duration itself based on the default requeue timeout. If backoff=true is set, then the connection will go into "backoff" mode, where it stops receiving messages for a fixed duration.
start_link(message, opts \\ [])
touch(message)
This function is intended to be used by the handler for long-running functions. They can set up a separate process that periodically touches the message until the process finishes.