Add high-level wrappers in zmq-api.lisp
[cl-zmq.git] / grovel.lisp
blobbb4e218fb606b52fc7b208e3d6967a12efa107ca
1 (include "zmq.h")
3 (in-package :cl-zmq)
5 ;; Maximal size of "Very Small Message". VSMs are passed by value
6 ;; to avoid excessive memory allocation/deallocation.
7 ;; If VMSs larger than 255 bytes are required, type of 'vsm_size'
8 ;; field in zmq_msg_t structure should be modified accordingly.
9 (constant (max-vsm-size "ZMQ_MAX_VSM_SIZE"))
11 ;; Message & notification types.
12 (constant (gap "ZMQ_GAP"))
13 (constant (delimiter "ZMQ_DELIMITER"))
14 (constant (vsm "ZMQ_VSM"))
16 ;; Socket options.
17 (constant (hwm "ZMQ_HWM")) ;; int64_t
18 (constant (lwm "ZMQ_LWM")) ;; int64_t
19 (constant (swap "ZMQ_SWAP")) ;; int64_t
20 (constant (affinity "ZMQ_AFFINITY")) ;; int64_t
21 (constant (identity "ZMQ_IDENTITY")) ;; string
22 (constant (subscribe "ZMQ_SUBSCRIBE")) ;; string
23 (constant (unsubscribe "ZMQ_UNSUBSCRIBE")) ;; string
24 (constant (rate "ZMQ_RATE")) ;; int64_t
25 (constant (recovery-ivl "ZMQ_RECOVERY_IVL")) ;; int64_t
26 (constant (mcast-loop "ZMQ_MCAST_LOOP")) ;; int64_t
28 ;; The operation should be performed in non-blocking mode. I.e. if it cannot
29 ;; be processed immediately, error should be returned with errno set to EAGAIN.
30 (constant (noblock "ZMQ_NOBLOCK"))
32 ;; zmq_send should not flush the message downstream immediately. Instead, it
33 ;; should batch ZMQ_NOFLUSH messages and send them downstream only if zmq_flush
34 ;; is invoked. This is an optimisation for cases where several messages are
35 ;; sent in a single business transaction. However, the effect is measurable
36 ;; only in extremely high-perf scenarios (million messages a second or so).
37 ;; If that's not your case, use standard flushing send instead. See exchange
38 ;; example for illustration of ZMQ_NOFLUSH functionality.
39 (constant (noflush "ZMQ_NOFLUSH"))
41 ;; Socket to communicate with a single peer. Allows for a singe connect or a
42 ;; single accept. There's no message routing or message filtering involved.
43 (constant (p2p "ZMQ_P2P"))
45 ;; Socket to distribute data. Recv fuction is not implemented for this socket
46 ;; type. Messages are distributed in fanout fashion to all peers.
47 (constant (pub "ZMQ_PUB"))
49 ;; Socket to subscribe to distributed data. Send function is not implemented
50 ;; for this socket type. However, subscribe function can be used to modify the
51 ;; message filter.
52 (constant (sum "ZMQ_SUB"))
54 ;; Socket to send requests on and receive replies from. Requests are
55 ;; load-balanced among all the peers. This socket type doesn't allow for more
56 ;; recv's that there were send's.
57 (constant (req "ZMQ_REQ"))
59 ;; Socket to receive requests from and send replies to. This socket type allows
60 ;; only an alternated sequence of recv's and send's. Each send is routed to
61 ;; the peer that the previous recv delivered message from.
62 (constant (rep "ZMQ_REP"))