blob: c60e357c4ea1dc0f97a49974a1e3d8727faa85b8 (
plain) (
tree)
|
|
defmodule GenMagic do
@moduledoc """
Top-level namespace for GenMagic, the libMagic client for Elixir.
"""
alias GenMagic.ApprenticeServer
@doc """
Top-level convenience function which creates an ad-hoc process. Usually
this will be wrapped in a pool established by the author of the application
that uses the library.
"""
def perform(path) do
{:ok, pid} = ApprenticeServer.start_link([])
result = ApprenticeServer.file(pid, path)
:ok = GenServer.stop(pid)
result
end
end
|