Skip to content

Commit

Permalink
Fix alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
maehjam committed Nov 14, 2024
1 parent b733133 commit bf9eee3
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions test/grisp_connect_test_async.erl
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
%--- API -----------------------------------------------------------------------

async_eval(Fun) ->
spawn_link(
fun() ->
Res = Fun(),
receive {'$async_get_result', Pid} ->
Pid ! {'$async_result', Res} end
end).
spawn_link(
fun() ->
Res = Fun(),
receive {'$async_get_result', Pid} ->
Pid ! {'$async_result', Res} end
end).

async_get_result(Pid) ->
unlink(Pid),
Pid ! {'$async_get_result', self()},
receive {'$async_result', Res} -> Res
after 1000 -> error({timeout, waiting_result})
end.
unlink(Pid),
Pid ! {'$async_get_result', self()},
receive {'$async_result', Res} -> Res
after 1000 -> error({timeout, waiting_result})
end.

0 comments on commit bf9eee3

Please sign in to comment.