Requesting a message back from the server
Simulating server push
A client application cannot pass a PowerBuilder
object reference to EAServer. Therefore,
you cannot use a PowerBuilder object reference to push messages from
the server back to a PowerBuilder client. However, you can simulate
this behavior by using a shared object on the client to communicate
with EAServer. This technique
can be thought of as client pull, because the shared object on the client
pulls data back from the server.
How it works
To simulate server push, the client uses the SharedObjectRegister and SharedObjectGet functions
to create a shared object. Once the object has been created, the
main thread on the client makes an asynchronous call to a method on
the shared object, passing it a callback object that should be notified
when processing has finished on the server. The method on the shared
object makes a synchronous call to the EAServer component
method that performs processing. Since the shared object is running
in a separate thread on the client, the main thread on the client
can proceed with other work while the process is running on the
server.
In this example, POST is used to make an
asynchronous call to a method on a shared object on the client.
Using POST is not supported
in the context of calls to EAServer components.
For information about asynchronous processing in EAServer, see the EAServer documentation for the ThreadManager
and MessageService modules.
For more information about the Thread Manager in EAServer
6.x, see the Automated Configuration Guide
. For information about
using the message service, see the Java Message Service User’s Guide
.