ZeroMQ Datatypes

 

With Lycia, distributed messaging between different processes and applications is achieved by applying a number of methods to objects of a corresponding data type.

 

data type

description

associated methods

ZMQ.Context

an object serving as a container for all the sockets of a single process.

By creating a new context, you start one or more input/output threads:

 

DEFINE context ZMQ.Context

 

socket()

term()

 

 

ZMQ.Socket

an object serving as an asynchronous message queue within the specified context, with the exact semantics depending on the socket type in use:

 

DEFINE responder ZMQ.Socket

 

Sockets are created by applying the socket() method to the object of ZMQ.Context type:

 

LET responder = context.Socket("socket_type")

 

bind()

unbind()

close()

connect()

getEvents()

recv()

send()

setBacklog()

setIdentity()

setLinger()

setMaxMsgSize()

getMechanism()

setReceiveBufferSize()

setReceiveTimeOut()

subscribe()

 

et al.

ZMQ.Poller

an object serving as a polling board: It questions the sockets on whether events of a certain type have occurred and signals the polling results:

 

DEFINE context ZMQ.Poller

 

register()

poll()

 

polerr()

pollin()

pollout()

 

ZMQ.Msg

an object holding the message which can be sent or received via any ZMQ socket:

 

DEFINE msg ZMQ.Msg

 

get()

init()

move()

copy()

size()

more()

clear()

 

Successful integration of ZeroMQ into Lycia requires from 4gl developers to be attentive and consistent with their coding.

We recommend you to use meaningful variables and thoroughly structure the 4gl code in order to ensure proper runtime behavior of your applications.