[Openchemistry-developers] MoleQueue JSON-RPC implementation
David Cole
david.cole at kitware.com
Sat May 5 10:44:21 EDT 2012
It does sound good. Looks like you could nearly compile the wiki page
and have it working today! :-)
On Fri, May 4, 2012 at 10:23 AM, David Lonie <david.lonie at kitware.com> wrote:
> I've put up a first pass at a design for the server/client communication
> classes for MoleQueue here:
>
> http://wiki.openchemistry.org/MoleQueue_JSON-RPC_Implementation
>
> The MoleQueueClient and JobRequest classes will be put into a separate
> library that a client (e.g. Avogadro) can link to. The client will obtain a
> JobRequest from a MoleQueueClient instance and set the job options on the
> JobRequest object. The client then asks MoleQueueClient to submit the
> request, which passes the JobRequest object to a JsonRpc class which
> generates the JSON snippet for the request and returns a QByteArray. The
> Client the passes the QByteArray to the LocalSocket.
>
> This pattern is used to generate all requests/notifications:
>
> 1. MoleQueue[Client|Server] receives request from user
> 2. MQ[C|S] passes request info to JsonRpc class to generate QByteArray
> 3. MQ[C|S] QByteArray is passed to QLocalSocket
>
> Reception of message is handled using the following design:
>
> 1. QLocalSocket informs MQ[C|S] of a new packet
> 2. MQ[C|S] passes packet to
> QVector<unsigned long> MoleQueue::JsonRpc::interpretIncoming(const
> QByteArray &);
> This function returns the JSON-RPC id. A vector is used so we can support
> batch requests.
> 3. The JsonRpc class interprets and identifies the packet, then emits a
> signal that is unique to the packet type with Qt-friendly arguments
> describing the packet contents.
> 4. The MQ[C|S] listens for the slots and acts appropriately on them.
>
> Sound good?
>
> Dave
>
> _______________________________________________
> Openchemistry-developers mailing list
> Openchemistry-developers at openchemistry.org
> http://public.kitware.com/cgi-bin/mailman/listinfo/openchemistry-developers
>
More information about the Openchemistry-developers
mailing list