From be9d6d9aed93030383206ebdd3f7eb742a1a655c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20K=C5=82osko?= Date: Tue, 23 Jul 2024 19:31:33 +0200 Subject: [PATCH] Fix code snippet (#47) --- lib/flame.ex | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/flame.ex b/lib/flame.ex index ca6879e..7490ed9 100644 --- a/lib/flame.ex +++ b/lib/flame.ex @@ -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. """