Skip to content

Instantly share code, notes, and snippets.

@l04m33
Created April 27, 2012 09:42
Show Gist options
  • Save l04m33/2507869 to your computer and use it in GitHub Desktop.
Save l04m33/2507869 to your computer and use it in GitHub Desktop.
a callback server - header file
-ifndef(__GEN_CALLBACK_SERVER_HRL__).
-define(__GEN_CALLBACK_SERVER_HRL__, 1).
-type process_ref() :: pid() | {atom(), node()}.
-type server_ref() :: pid() | {{local, atom()} | {global, term()} | {via, module(), term()}, node()}.
-define(RECEIVE_CB, (fun gen_callback_server:receive_cb/2)).
-define(REPLY_CB, (fun gen_callback_server:reply_cb/1)).
-define(CLIENT_REPLY_CB, (fun gen_callback_server:client_reply_cb/1)).
-define(MIXED_REPLY_CB, (fun gen_callback_server:mixed_reply_cb/1)).
-record(cb_event,
{
reply_to = none :: process_ref() | none,
cb_arg = none :: any(),
msg_ref = none :: reference() | none,
sent_from = none :: server_ref() | none,
context = none :: any()
}).
-endif.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment