From 2cd331fec3e08799bdd482399e8c969102e1142f Mon Sep 17 00:00:00 2001 From: Raimo Niskanen Date: Thu, 17 Mar 2016 16:05:35 +0100 Subject: Change Caller -> From as suggested by Fred Hebert --- lib/stdlib/doc/src/gen_statem.xml | 50 +++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'lib/stdlib/doc') diff --git a/lib/stdlib/doc/src/gen_statem.xml b/lib/stdlib/doc/src/gen_statem.xml index 90d2326954..83f7dc1c8a 100644 --- a/lib/stdlib/doc/src/gen_statem.xml +++ b/lib/stdlib/doc/src/gen_statem.xml @@ -253,23 +253,23 @@ init([]) -> %%% State functions -off({call,Caller}, push, Data) -> +off({call,From}, push, Data) -> %% Go to 'on', increment count and reply %% that the resulting status is 'on' - {next_state,on,Data+1,[{reply,Caller,on}]}; + {next_state,on,Data+1,[{reply,From,on}]}; off(EventType, EventContent, Data) -> handle_event(EventType, EventContent, Data). -on({call,Caller}, push, Data) -> +on({call,From}, push, Data) -> %% Go to 'off' and reply that the resulting status is 'off' - {next_state,off,Data,[{reply,Caller,off}]}; + {next_state,off,Data,[{reply,From,off}]}; on(EventType, EventContent, Data) -> handle_event(EventType, EventContent, Data). %% Handle events common to all states -handle_event({call,Caller}, get_count, Data) -> +handle_event({call,From}, get_count, Data) -> %% Reply with the current count - {keep_state,Data,[{reply,Caller,Data}]}; + {keep_state,Data,[{reply,From,Data}]}; handle_event(_, _, Data) -> %% Ignore all other events {keep_state,Data}. @@ -315,18 +315,18 @@ init([]) -> %%% Event handling -handle_event({call,Caller}, push, off, Data) -> +handle_event({call,From}, push, off, Data) -> %% Go to 'on', increment count and reply %% that the resulting status is 'on' - {next_state,on,Data+1,[{reply,Caller,on}]}; -handle_event({call,Caller}, push, on, Data) -> + {next_state,on,Data+1,[{reply,From,on}]}; +handle_event({call,From}, push, on, Data) -> %% Go to 'off' and reply that the resulting status is 'off' - {next_state,off,Data,[{reply,Caller,off}]}; + {next_state,off,Data,[{reply,From,off}]}; %% %% Event handling common to all states -handle_event({call,Caller}, get_count, State, Data) -> +handle_event({call,From}, get_count, State, Data) -> %% Reply with the current count - {next_state,State,Data,[{reply,Caller,Data}]}; + {next_state,State,Data,[{reply,From,Data}]}; handle_event(_, _, State, Data) -> %% Ignore all other events {next_state,State,Data}. @@ -429,12 +429,12 @@ handle_event(_, _, State, Data) -> - +

Destination to use when replying through for example the - action() {reply,Caller,Reply} + action() {reply,From,Reply} to a process that has called the gen_statem server using call/2. @@ -483,7 +483,7 @@ handle_event(_, _, State, Data) ->

External events are of 3 different type: - {call,Caller}, cast or info. + {call,From}, cast or info. Calls (synchronous) and casts @@ -739,9 +739,9 @@ handle_event(_, _, State, Data) ->

Reply to a caller waiting for a reply in call/2. - Caller must be the term from the + From must be the term from the - {call,Caller} + {call,From} argument to the state function. @@ -1029,14 +1029,14 @@ handle_event(_, _, State, Data) -> The gen_statem will call the state function with event_type() - {call,Caller} and event content + {call,From} and event content Request.

A Reply is generated when a state function returns with - {reply,Caller,Reply} as one + {reply,From,Reply} as one action(), and that Reply becomes the return value of this function. @@ -1100,13 +1100,13 @@ handle_event(_, _, State, Data) -> state function.

- Caller must be the term from the + From must be the term from the - {call,Caller} + {call,From} argument to the state function. - Caller and Reply + From and Reply can also be specified using a reply_action() @@ -1340,15 +1340,15 @@ handle_event(_, _, State, Data) ->

If EventType is - {call,Caller} + {call,From} the caller is waiting for a reply. The reply can be sent from this or from any other state function - by returning with {reply,Caller,Reply} in + by returning with {reply,From,Reply} in Actions, in Replies or by calling - reply(Caller, Reply). + reply(From, Reply).

If this function returns with a next state that -- cgit v1.2.3