zeromq / chumak

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

fix: return socket pid if already started #51

Closed thalesmg closed 2 years ago

thalesmg commented 2 years ago

When a socket with an identity is already started, the chumak:socket/2 function returns {error, {already_stared, pid()}}, which is the return of supervisor:start_child/2 for that case. This violates the typespec of chumak:socket/2.

This patch changes that to return the already started socket PID to the caller.