• Swann Perarnau's avatar
    [refactor] daemon should always bind on sockets · 1391a197
    Swann Perarnau authored
    The way 0MQ works on PUB/SUB sockets, publishers might drop
    messages if subscribers are not detected faster enough. One way to fix
    it is to have the "server" always bind sockets, and the "client" use
    connect. This way, the handshake is initiated properly, and the client
    can publish as soon as the connection is done.
    This patch makes the daemon bind on the upstream API and the CLI connect,
    fixing in the process the message dropping we were experiencing before.
    Long term, we might have a think of using 2 types of sockets for the
    upstream API: pub/sub for actual events published from the daemon, and
    a REQ/REP or ROUTER/DEALER pair for "commands".
daemon.py 11.3 KB