mirror of
https://github.com/correl/rebar.git
synced 2024-11-23 19:19:54 +00:00
9f057f29c5
This borrows heavily from the inttest for gpb, many thanks to Luis Rascão for providing a most useful example.
35 lines
776 B
Erlang
35 lines
776 B
Erlang
%% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*-
|
|
%% ex: ts=4 sw=4 et
|
|
-module(foo).
|
|
|
|
-export([start_link/0,
|
|
start_link/1,
|
|
init/1,
|
|
terminate/2,
|
|
handle_info/2,
|
|
handle_call/3,
|
|
handle_cast/2,
|
|
code_change/3]).
|
|
|
|
-behavior(gen_server).
|
|
|
|
-include("../include/test_pb.hrl").
|
|
|
|
-record(state, {node :: node()}).
|
|
|
|
start_link() -> start_link(undefined).
|
|
|
|
start_link(Args) ->
|
|
gen_server:start_link({local, ?MODULE}, ?MODULE, Args, []).
|
|
|
|
init(_Args) -> {ok, #state{node=node()}}.
|
|
|
|
terminate(_Reason, _Data) -> ok.
|
|
|
|
handle_info(_Info, State) -> {noreply, State}.
|
|
|
|
handle_cast(_Msg, State) -> {noreply, State}.
|
|
|
|
handle_call(_Msg, _From, State) -> {reply, ok, State}.
|
|
|
|
code_change(_OldVsn, State, _Extra) -> {ok, State}.
|