Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Last active September 6, 2018 11:29
Embed
What would you like to do?
def handle_info({:replication_log, logEntry}, worker) do
newWorkerState =
if logEntry.origin == worker.name do
worker
else
%{ worker |
clock: max(worker.clock, logEntry.time) + 1,
eventLog: [logEntry | worker.eventLog] }
end
{:noreply, newWorkerState }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment