Created
November 29, 2011 20:31
-
-
Save archie/1406348 to your computer and use it in GitHub Desktop.
Dummy application that use gaoler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-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!", []). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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)