Skip to content

Commit 65cdd73

Browse files
committed
Updated README
1 parent 50d2e0c commit 65cdd73

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,15 @@ to each other.
7979
* `Scheduler.run(fun, args, context = null)` - A static generator function used to wrap a normal function or generator. If fun is a function, it returns the value, if it's a generator, then it delegates yielding to the generator.
8080

8181
* GenServer
82-
* **Note**: Genserver expects a module the has the following functions:
83-
* `init(args)` - Must return an array containing a symbol and the initial state
84-
* `handle_call(action, from, state)` - Called when `GenServer.call` is called. This function is given the action, the pid of the calling process, and the current state. Must return `[reply, return_value, new_state]` where reply is a symbol ,usually `Symbol.for("reply"), the value to return to the process, and lastly, the new state of the GenServer.
85-
* handle_cast(action, state) - Called when `GenServer.cast` is called. his function is given the action, and the current state. Must return `[reply, return_value, new_state]` where reply is a symbol ,usually `Symbol.for("noreply"), and lastly, the new state of the GenServer.
86-
8782
* `start(module, args)` - Starts a GenServer with the given module and args
8883
* `start_link(module, args)` - Starts a GenServer with the given module and args
8984
* `call* (server, action) - Sends the GenServer a action and waits for it to respond with a value.
9085
* `cast* (server, action) - Sends the GenServer a action to update a value.
9186
* `stop (server) - Stops the GenServer.
87+
* **Note**: Genserver expects a module the has the following functions:
88+
* `init(args)` - Must return an array containing a symbol and the initial state
89+
* `handle_call(action, from, state)` - Called when `GenServer.call` is called. This function is given the action, the pid of the calling process, and the current state. Must return `[reply, return_value, new_state]` where reply is a symbol ,usually `Symbol.for("reply"), the value to return to the process, and lastly, the new state of the GenServer.
90+
* handle_cast(action, state) - Called when `GenServer.cast` is called. his function is given the action, and the current state. Must return `[reply, return_value, new_state]` where reply is a symbol ,usually `Symbol.for("noreply"), and lastly, the new state of the GenServer.
9291

9392
#### GenServer Example
9493

0 commit comments

Comments
 (0)