Interfacing EMG using Ruby Print
Tuesday, 13 March 2007

Overview

The Ruby API uses the MGP protocol and therefore an incoming MGP connector needs to be defined in server.cfg for access via the Ruby API to be possible. In the code samples we use the default MGP connector configuration included in the EMG distribution.

Best practice

It is considered best practice to keep the session when performing multiple operations. That is, multiple operations can be performed without corresponding login and close operations. Creating a new session will impose overhead and impact performance severely. The easiest way to do this is to give the username and password to the connect() function, as in the Send.rb example, or the block version of the login() function, as in the Receive.rb example.

More information

Ruby applications can communicate with EMG using the Ruby implementation of the MGP protocol. Files are freely available for download from theĀ download section.

The RDoc for the API can be found in the documentation section and includes code samples for sending and receiving messages.