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 loop endif data = json_decode(msg) // Now process the message which is now encoded as an object // … enddo
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) mqClose(mqdes)
Alternatively you can combine all the above code into a shortened version:
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