Skip to content

Instantly share code, notes, and snippets.

@kevsmith
Forked from boorad/gist:61216
Created February 10, 2009 03:43
Show Gist options
  • Save kevsmith/61221 to your computer and use it in GitHub Desktop.
Save kevsmith/61221 to your computer and use it in GitHub Desktop.
handle_call({insert, Value}, _From, State) ->
NextNode = node_manager:next_node(?METHOD),
NextDb = db_manager:next_db_node(NextNode),
db_node:insert_value(Value),
------
On the db_manager module:
next_db_node(DbManagerPid) ->
gen_server:call(DbManagerPid, {next_db, ?METHOD}).
------
On the db_node module:
insert_value(DbPid, Value) ->
gen_server:call(DbPid, {insert, null, Value}).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment