Skip to content

Instantly share code, notes, and snippets.

@tonysun83
Created October 1, 2014 18:38
Show Gist options
  • Save tonysun83/77d0f289f75d8ab0a1a8 to your computer and use it in GitHub Desktop.
Save tonysun83/77d0f289f75d8ab0a1a8 to your computer and use it in GitHub Desktop.
handle_message(start_search, {Worker, From}, State) ->
twig:log(notice, "START A MESSAGE"),
rexi:stream_ack(From),
{ok, State};
handle_message({ok, {hits,Val}}, {Worker, From}, State) ->
rexi:stream_ack(From),
{Req,Resp} = State#state.http_resp,
send_chunk(Resp,?JSON_ENCODE(Val)),
{ok, State};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment