-
-
Notifications
You must be signed in to change notification settings - Fork 120
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
A couple of loose ideas #2
Comments
jlouis: first of all, thanks for your interest! 1), 2) I'm a bit reluctant to bring in another dependency for that; I tend to like to keep dependencies minimal.
|
This is a very good point. The sockjs-protocol is by no means done, and it's not yet clear (in my head) how much it should explain and how much just focus on testing. Feedback welcome! I've added some prose about framing: sockjs/sockjs-protocol@77959f4 Shout if there's something more missing. I think that the prose should explain general ideas, and not focus on details, but that's open for a discussion. |
Added a bug for that #4 |
I think we've answered all the points. Closing. Shout if I missed anything. |
There will be a simple stress test as a part of protocol definition: |
Update Cowboy to 1.0.3
Code formatting
Here is a list of things you can do in the code base I saw after skimming through it.
gen_server
process stores SessionIDs in an ETS table. This mapping of Id to Pid is quite common in Erlang, so there is a project, esl/gproc@master , which does exactly that.monitor
on your process and clean up if your process terminates.go
to a process when it enqueues is a bit dangerous. Other processes might sendgo
back. Consider some unique reference with the callmake_ref/0
and send that along, so it is safe. Perhaps you can write all of it via agen_server:call/3
and then usegen_server:reply/2
if the reply has to be sent asynchronously.iolist_to_binary/1
in the code. If possible, consider sendingiolist()
constructions around instead. Many output functions takesiolist()
s. Converting them to binaries means that you traverse theiolist()
and copy its data to a new binary you form on the fly. This copying may be unnecessary, takes time, and it increases the pressure on the binary-allocator in the Erlang VM.Finally:
The text was updated successfully, but these errors were encountered: