Skip to content

Instantly share code, notes, and snippets.

@renatorozas
Last active March 10, 2016 14:42
Show Gist options
  • Save renatorozas/4a4e8807e3f78c4751bb to your computer and use it in GitHub Desktop.
Save renatorozas/4a4e8807e3f78c4751bb to your computer and use it in GitHub Desktop.
Getting started with gen_server
% Defines the module.
-module(kv_db_server).
% Makes the module implement the gen_server behaviour.
-behaviour(gen_server).
% Exports the required gen_server callbacks.
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3]).
% Exports public functions that will ease interaction
% with the gen server.
-export([start/0]).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment