Remove GenServer from FFI.Library
This commit is contained in:
@@ -6,6 +6,4 @@ defmodule MyLib do
|
|||||||
attach_function :puts, [:string], :int
|
attach_function :puts, [:string], :int
|
||||||
end
|
end
|
||||||
|
|
||||||
{:ok, pid} = MyLib.start_link
|
IO.inspect MyLib.puts("Hello world")
|
||||||
|
|
||||||
MyLib.puts(pid, "Hello world")
|
|
||||||
|
|||||||
@@ -2,13 +2,6 @@ defmodule FFI.Library do
|
|||||||
defmacro __using__(_x) do
|
defmacro __using__(_x) do
|
||||||
quote do
|
quote do
|
||||||
import FFI.Library
|
import FFI.Library
|
||||||
|
|
||||||
def start_link(args \\ []) do
|
|
||||||
GenServer.start_link(__MODULE__, :init, [])
|
|
||||||
end
|
|
||||||
|
|
||||||
def init(state),
|
|
||||||
do: {:ok, state}
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user