Skip to content

Instantly share code, notes, and snippets.

@archie
Created November 29, 2011 20:31
Show Gist options
  • Save archie/1406348 to your computer and use it in GitHub Desktop.
Save archie/1406348 to your computer and use it in GitHub Desktop.
Dummy application that use gaoler
-module(dummy).
-export([important_task/0]).
important_task() ->
gaoler:acquire(beer),
drink_beer(),
gaoler:release(beer).
drink_beer() ->
io:format("I'm a happy application!", []).
@nruth
Copy link

nruth commented Nov 29, 2011

Nice, but I don't like having arbitrary fun/code sent to server.

Would prefer closures resembling ruby blocks, e.g.

CriticalRegion = fun() -> io:format("spamming the terminal"),
gaoler:execute_critical(beer, CriticalRegion)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment