Skip to content

Commit

Permalink
Fix code snippet (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatanklosko committed Jul 23, 2024
1 parent 6c4e155 commit be9d6d9
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions lib/flame.ex
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,16 @@ defmodule FLAME do
## Examples
def my_expensive_thing(arg) do
FLAME.call(MyApp.Runner, fn ->
# I'm now doing expensive work inside a new node
# pubsub and repo access all just work
Phoenix.PubSub.broadcast(MyApp.PubSub, "topic", result)
# can return awaitable results back to caller
result
end)
def my_expensive_thing(arg) do
FLAME.call(MyApp.Runner, fn ->
# I'm now doing expensive work inside a new node
# pubsub and repo access all just work
Phoenix.PubSub.broadcast(MyApp.PubSub, "topic", result)
# can return awaitable results back to caller
result
end)
end
When the caller exits, the remote runner will be terminated.
"""
Expand Down

0 comments on commit be9d6d9

Please sign in to comment.