Update docs

This commit is contained in:
José Valim
2023-11-01 10:34:55 +01:00
parent b2e68903a9
commit f5a61d15b7
2 changed files with 11 additions and 13 deletions
-11
View File
@@ -8,17 +8,6 @@ defmodule GenServer do
will have a standard set of interface functions and include functionality for
tracing and error reporting. It will also fit into a supervision tree.
```mermaid
graph TD
GenServer
GenServer -. reply -.-> A
GenServer -. reply -.-> B
GenServer -. reply -.-> C
A(Client #1) -- request --> GenServer
B(Client #2) -- request --> GenServer
C(Client #3) -- request --> GenServer
```
## Example
The GenServer behaviour abstracts the common client-server interaction.
+11 -2
View File
@@ -326,8 +326,17 @@ defmodule Module do
### `@nifs` (since v1.16.0)
A list of functions and their arities which will be overridden
by a native implementation (NIF). See the Erlang documentation
for more information: https://www.erlang.org/doc/man/erl_nif
by a native implementation (NIF).
defmodule MyLibrary.MyModule do
@nifs [foo: 1, bar: 2]
def foo(arg1), do: :erlang.nif_error(:not_loaded)
def bar(arg1, arg2), do: :erlang.nif_error(:not_loaded)
end
See the Erlang documentation for more information:
https://www.erlang.org/doc/man/erl_nif
### `@on_definition`