How to implement an asynchronous backend

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to implement an asynchronous backend

Tulipe Hadrien

Hi all,

 

I have trouble finding a way to solve the following problem with 52n’s WPS. Maybe someone can help me.

 

I have a business logic service which exposes its own, non-standard, API. I’d like to add a WPS layer over it to expose methods in a standard way. For that purpose I was thinking of overriding one of AbstractAlgorithm classes for each of my service method. My issue is that my service (which would act as a backend) is asynchronous. Exactly, methods are called and a ping URL is directly returned. Once the process has finished, the ping URL will return an OK status, meanwhile it returns a PENDING status.

 

The problem is that the “IAlgorthim.run” method returns the result directly. I saw in “LongRunningDummyTestClass” that “Thread.sleep” is used to wait for completion of long processes. Is that the recommended way of doing? My processes can take more than 2 days and I would not prefer maintaining a Java thread for so long.

 

Many thanks for your help.




Ce message et les pièces jointes sont confidentiels et réservés à l'usage exclusif de ses destinataires. Il peut également être protégé par le secret professionnel. Si vous recevez ce message par erreur, merci d'en avertir immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant être assurée sur Internet, la responsabilité de Worldline ne pourra être recherchée quant au contenu de ce message. Bien que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne saurait être recherchée pour tout dommage résultant d'un virus transmis.

This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Worldline liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted.

_______________________________________________
Geoprocessingservices mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/geoprocessingservices
http://geoprocessing.forum.52north.org
Please respect our mailing list guidelines:
http://52north.org/resources/mailing-lists-and-forums/guidelines