zeromq / chumak

Pure Erlang implementation of ZeroMQ Message Transport Protocol.
Mozilla Public License 2.0
197 stars 47 forks source link

Is socket thread(process) safe? #26

Closed larrymeng closed 6 years ago

larrymeng commented 6 years ago

Is it safe to share the same connection? (call from 2 or more erlang processes.)

Thanks,

drozzy commented 6 years ago

Yes, socket is a gen_server, so any "calls" you make to it just get converted to messages in a mailbox:

https://github.com/zeromq/chumak/blob/master/src/chumak_socket.erl

drozzy commented 6 years ago

Closing, feel free to re-open if this is still an issue.