1-module(gs2). 2-vsn(1). 3-behaviour(gen_server). 4 5-export([is_operation_ok/1]). 6-export([init/1, handle_call/3, handle_cast/2, handle_info/2, 7 terminate/2, code_change/3]). 8 9is_operation_ok(Op) -> 10 gen_server:call(gs2, {is_operation_ok, Op}). 11 12init([Data]) -> 13 {ok, []}. 14 15handle_call({is_operation_ok, Op}, _From, State) -> 16 Data = gs1:get_data(), 17 Reply = lists2:assoc(Op, Data), 18 {reply, Reply, State}. 19 20handle_cast(_Request, State) -> 21 {noreply, State}. 22 23handle_info(_Info, State) -> 24 {noreply, State}. 25 26terminate(_Reason, _State) -> 27 ok. 28 29code_change(_OldVsn, State, _Extra) -> 30 {ok, State}. 31 32