Lastly, I was trying to implement a macro with similar functionality as 
assert_receive from ExUnit. The purpose of this macro was to allow the user 
to wait synchronously for a message specified by a pattern. The given 
pattern may contain variables that the user is interested to extract from 
the arrived message (exactly as in ExUnit.assert_receive). I've noticed 
that there is a significant amount of code that expands the given pattern 
and then collects the variables from it etc. in order to properly extract 
variables from the pattern. I have a feeling that it is not a valid 
solution to use an ExUnit.assert_receive in the production code, so maybe 
it would be possible to add the function of similar functionality to the 
Process module. Something like Process.await_message(). Another possibly 
better solution could be adding some functionality to the Macro module that 
would cover expanding the macro and collecting variables etc. 
(https://github.com/elixir-lang/elixir/blob/a64d42f5d3cb6c32752af9d3312897e8cd5bb7ec/lib/ex_unit/lib/ex_unit/assertions.ex#L467)

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/c01152e0-aabf-48dd-b1dd-3f3d0a9b7073n%40googlegroups.com.

Reply via email to