Skip to content

Instantly share code, notes, and snippets.

@martincabrera
Created February 22, 2021 17:23
Show Gist options
  • Save martincabrera/fccea14a87d8dfab560bddeded9abb4b to your computer and use it in GitHub Desktop.
Save martincabrera/fccea14a87d8dfab560bddeded9abb4b to your computer and use it in GitHub Desktop.
Elixir PythonWorker call function
def call(json_input) do
Task.async(fn ->
:poolboy.transaction(
:worker,
fn pid ->
GenServer.call(pid, {:optimize, json_input})
end,
@timeout
)
end)
|> Task.await(@timeout)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment