Skip to content

Instantly share code, notes, and snippets.

@philipcristiano
Created December 23, 2014 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philipcristiano/72b6f9668f93c668c583 to your computer and use it in GitHub Desktop.
Save philipcristiano/72b6f9668f93c668c583 to your computer and use it in GitHub Desktop.
-include_lib("riak_core/include/riak_core_vnode.hrl").
send_command(Pid, Request) ->
Ref = make_ref(),
gen_fsm:send_event(Pid, ?VNODE_REQ{request=Request,
sender={raw, Ref, self()}}),
{ok, Ref}.
get_response(Ref) ->
receive {Ref, M} -> {ok, M}
after 1000 -> error
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment