Skip to content

Instantly share code, notes, and snippets.

@essen
Created December 26, 2011 10:18
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 essen/1520860 to your computer and use it in GitHub Desktop.
Save essen/1520860 to your computer and use it in GitHub Desktop.
goldrush API
-module(goldrush).
application:start(goldrush)
%% Start daemons under goldrush supervision tree.
start_daemon(Name, Module, Options)
stop_daemon(Name)
%% Daemons started this way must define:
start_link(Name, Options)
%% Send an event (of the form {DaemonName, Message}).
event(Message)
%% Routes are just funs since it allows greater configurability.
add_route(Name, Fun)
replace_route(Name, Fun)
enable_route(Name)
disable_route(Name)
rm_route(Name)
%% This is how route funs are supposed to look like.
route_fun([{daemon_name, Message}|Tail]) ->
ok %% If we emptied the buffer.
{ok, Buffer} %% If we bufferized a few things.
%% We can of course have a few existing routes by default.
fun goldrush_folsom:route/1
fun goldrush_lager:route/1
fun goldrush_saloon:route/1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment