We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8765d24 commit 42c790aCopy full SHA for 42c790a
1 file changed
test/support/async_sync.ex
@@ -0,0 +1,27 @@
1
+defmodule Phoenix.LiveViewTest.Support.AsyncSync do
2
+ def wait_for_async_ready_and_monitor(name) do
3
+ receive do
4
+ :async_ready -> :ok
5
+ end
6
+
7
+ async_ref = Process.monitor(name)
8
+ send(name, :monitoring)
9
10
11
+ :monitoring_received -> :ok
12
13
14
+ async_ref
15
16
17
+ def register_and_sleep(notify_name, register_name) do
18
+ Process.register(self(), register_name)
19
+ send(notify_name, :async_ready)
20
21
22
+ :monitoring ->
23
+ send(notify_name, :monitoring_received)
24
+ Process.sleep(:infinity)
25
26
27
+end
0 commit comments