Created
December 2, 2014 01:14
-
-
Save dieswaytoofast/6eae22b71d1febc04318 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| perform_gc(Handler) -> | |
| safe_cast(Handler, {perform_gc}). | |
| init([{Party, _Client} = Account]) -> | |
| % something here | |
| {ok, Timer} = timer:apply_interval(?ACCOUNT_GC_TIMER, ?MODULE, perform_gc, [self()]), | |
| State = #state{gc_timer = Timer}. | |
| handle_cast({perform_gc}, State) -> | |
| garbage_collect(), | |
| {noreply, State}. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment