ex_nsq v1.1.0 NSQ.Message

Link to this section Summary

Functions

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

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

Link to this section Functions

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.

Link to this function from_data(data)

Given a raw NSQ message with frame_type = message, return a struct with its parsed data.

Link to this function process(message)

This is the main entry point when processing a message. It starts the message GenServer and immediately kicks of a processing call.

Link to this function 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.

Link to this function start_link(message, opts \\ [])

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.