Web services

Lianja 3.4 provides cross-platform consumer/producer message processing functions which can be used very effectively with web services.

These functions provide cross-platform messaging enabling you to offload slow processing e.g. send email, to a background service.

On Windows the messaging functions are implemented using named pipes and on Linux using POSIX message queues.

Firstly you create your “consumer” and run it as a scheduled task in Windows or a cron job in Linux:

local mqdes, msg, data

// Create the consumer and wait for a connection
mqdes = mqCreate(“unique_name_of_your_consumer”)

// loop processing messages as they come in from multiple producers
do while .t.
       msg = mqReceive(mqdes)
        if len(msg)=0
        data = json_decode(msg)
        // Now process the message which is now encoded as an object
        // …

Now the producer(s) code looks like this:

// Create the consumer and wait for a connection
mqdes = mqOpen(“unique_name_of_your_consumer”)
msg = json_encode(anobject)
mqSend(mqdes, msg)

Alternatively you can combine all the above code into a shortened version:

mqSendMessage(“unique_name_of_your_consumer”,  json_encode(anobject))


In a JavaScript application, I am trying to add a blank grid and then populate it later from an array using additems().

I know this is not yet supported in custom sections, but I thought it may be possible in a standard section.



Custom grids which can be loaded from an external web service are now implemented in 4.0.1