• Lukas Rieder's avatar
    Implemented a c-node · d5a9653e
    Lukas Rieder authored
    My first attempt was writing a threaded c-node server, but that
    fails dramatically if it is connected to multiple nodes.
    
    OS-Process separation might be the best way to go, also for scaling this
    out, as the footprint of a c-node client is relatively small.
    
    So for that reason, I wrote priv/cclient, and lib/myhtmlex/safe/cnode.ex.
    The Myhtmlex.Safe.Cnode module is a gen server that allows the cclient
    to be part of a supervision tree.
    
    This is accomplished by issuing Node.monitor as soon as the cclient is
    connected to our node. If cclient dies for some reason, a :nodedown
    event will be trigger and brings down the GenServer.
    Allowing a supervisor to restart the cclient.
    
    There is quite some performance overhead when using the cclient, but
    that was expected due to the message serialisation going on. Its not too
    bad.
    d5a9653e
myhtmlex.ex 5.33 KB