Module amqp_gen_consumer

A behaviour module for implementing consumers for amqp_channel.

Behaviours: gen_server2.

This module defines the amqp_gen_consumer behaviour.
Required callback functions: init/1, handle_consume/3, handle_consume_ok/3, handle_cancel/2, handle_cancel_ok/3, handle_server_cancel/2, handle_deliver/3, handle_deliver/4, handle_info/2, handle_call/3, terminate/2.

Description

A behaviour module for implementing consumers for amqp_channel. To specify a consumer implementation for a channel, use amqp_connection:open_channel/{2,3}.
All callbacks are called within the gen_consumer process.

See comments in amqp_gen_consumer.erl source file for documentation on the callback functions.
Note that making calls to the channel from the callback module will result in deadlock.

Data Types

ok_error()

ok_error() = {ok, state()} | {error, reason(), state()}

Denotes a successful or an error return from a consumer module call.

Function Index

call_consumer/2This function is used to perform arbitrary calls into the consumer module.
call_consumer/3This function is used by amqp_channel to forward received methods and deliveries to the consumer module.
call_consumer/4
code_change/3
handle_call/3
handle_cast/2
handle_info/2
init/1
prioritise_info/3
start_link/3
terminate/2

Function Details

call_consumer/2

call_consumer(Pid::Consumer, Msg) -> ok

This function is used to perform arbitrary calls into the consumer module.

call_consumer/3

call_consumer(Pid::Consumer, Method, Args) -> ok

This function is used by amqp_channel to forward received methods and deliveries to the consumer module.

call_consumer/4

call_consumer(Pid, Method, Args, DeliveryCtx) -> any()

code_change/3

code_change(OldVsn, State, Extra) -> any()

handle_call/3

handle_call(X1, From, State) -> any()

handle_cast/2

handle_cast(What, State) -> any()

handle_info/2

handle_info(Info, State) -> any()

init/1

init(X1) -> any()

prioritise_info/3

prioritise_info(X1, Len, State) -> any()

start_link/3

start_link(ConsumerModule, ExtraParams, Identity) -> any()

terminate/2

terminate(Reason, State) -> any()


Generated by EDoc