Permalink
Fetching contributors…
Cannot retrieve contributors at this time
74 lines (56 sloc) 2.08 KB

unserding

Build Status

unserding is a simple pub-sub messaging library, much like 0mq or nanomsg, without all the transports they support and without the reliability promise, made for heavy-duty realtime delivery of time series.

unserding uses udp6 multicast to span ad-hoc topologies (on ff0x::134) and uses a simple tag-length-value wire protocol to propagate messages.

C API

The C API is similar to pimmel's in design:

/* for the waiter */
ud_sock_t s = ud_socket(UD_SUB);

while (pselect|poll|epoll(s->fd, ...)) {
        struct ud_msg_s msg[1];

        while (ud_chck_msg(s, msg) >= 0) {
                /* inspect the message contents */
                msg->data ...
        }
        break;
}
ud_close(s);

where pselect, poll, or epoll guts have been omitted for clarity.

The publisher part is similarly simple:

/* for the notifier */
ud_sock_t s = ud_socket(UD_PUB);

/* pack a simple message */
ud_pack_msg(s, (ud_msg_s){.svc = 0xffff/*test service*/,
        .dlen = 4,
        .data = "TEST",
    });
ud_flush(s);
ud_close(s);

Examples

Several dedicated projects utilise unserding networks to pass on messages, typically in the field of financial trading systems.

Most notable among these is unsermarkt, which in turn uses the tick encoding capabilities of uterus to provide real-time tick data streaming. And moreover it defines a service (that can be plugged into unsermon) to encode and decode such streams.

The unsermarkt project (aided by e.g. twsgluum) also demonstrates how to send or receive FIX messages in unserding networks.