-
Notifications
You must be signed in to change notification settings - Fork 23
/
empty.ex
31 lines (24 loc) · 770 Bytes
/
empty.ex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
defmodule ExActor.Empty do
@moduledoc """
Empty predefine. Imports all ExActor macros, but doesn't provide any default
implementation. The declaring module must define all required functions
of the `gen_server` behaviour.
Example:
defmodule MyServer do
use ExActor.Empty
# define all gen_server required functions
end
# Locally registered name:
use ExActor.Empty, export: :some_registered_name
# Globally registered name:
use ExActor.Empty, export: {:global, :global_registered_name}
"""
defmacro __using__(opts) do
quote do
@behaviour :gen_server
import ExActor.Operations
import ExActor.Responders
unquote(ExActor.Helper.init_generation_state(opts))
end
end
end