forked from ParaPhrase/skel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgen_sk.erl
38 lines (30 loc) · 1.04 KB
/
gen_sk.erl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
%%%----------------------------------------------------------------------------
%%% @hidden
%%% @author Sam Elliott <ashe@st-andrews.ac.uk>
%%% @copyright 2012 University of St Andrews (See LICENCE)
%%% @doc This is the start of a generic way to specify sk processes using
%%% callbacks.
%%%
%%% It's completely unfinished.
%%%
%%% @end
%%%----------------------------------------------------------------------------
-module(gen_sk).
-include("skel.hrl").
-ifdef(TEST).
-compile(export_all).
-endif.
-callback init(Args :: term()) ->
{ok, State :: term()}.
-callback handle_data(Message :: data_message(), State :: term()) ->
{forward, Message1 :: [ data_message(),...], NewState :: term()} |
{eos, NewState :: term()}.
-callback handle_system(Message :: data_message(), State :: term()) ->
{forward, NewState :: term()} |
{drop, NewState :: term()} |
{eos, NewState :: term()}.
-callback handle_info(Info :: term(), State :: term()) ->
{ok, NewState :: term()} |
{eos, NewState :: term()}.
-callback terminate(State :: term()) ->
ok.