-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syn decode in publisher #6
base: master
Are you sure you want to change the base?
Conversation
f4ac564
to
a8e74ff
Compare
@@ -1,6 +1,7 @@ | |||
defmodule WalEx.Event.Dsl do | |||
defmacro process_events_async(events, functions) do | |||
module = hd(__CALLER__.context_modules) | |||
[_ | _] = __CALLER__.context_modules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this line useful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, context_modules can be an empty list according to its type
if so this macro should crash
List.first returns a nil value in that case
7c286f0
to
964578e
Compare
Experiment to check if moving decoding in Publisher and outside the main connection server allows to increase its throughput
error: warning: incompatible types given to Kernel.hd/1: hd(__CALLER__.context_modules) given types: list(atom()) but expected one of: non_empty_list(term(), term()) typing violation found at: │ 3 │ module = hd(__CALLER__.context_modules) │ ~ │ └─ lib/walex/event/dsl.ex:3:14: WalEx.Event.Dsl.process_events_async/2
964578e
to
c748033
Compare
…an receive many messages following erlang doc: > If the process may potentially accumulate a large number of messages in its queue it is recommended to set the flag value to off_heap.
move decoding of raw binary messages out of the hot-path
might help reduce walex lag