#1 2012-09-20 09:25:35

h.hasenack
Member
From: Nijmegen, Netherlands
Registered: 2012-08-01
Posts: 173
Website

How to implement a server->client notification

Imagine my client starting lengthty process on the server.
And the server (multithreadedly) generates progress information to a point where the processing has finished.

What I want basically are 2 things:
1) display progress that has been made during processing, including warnings and errors.
2) Auto update charts/forms based on a 'new data arrived' notification from the server

While I could do this using a sleep/polling loop on the client side, this feels "bad" to me. So I obviously need some kind of notification system (messages, callbacks?) to get around this.
Taking a quick look at the docs did not point me in the right direction, so... I do I get around this?

Hans

Offline

#2 2012-09-20 11:35:36

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: How to implement a server->client notification

Take a look at the "stateless" keyword in the documentation.
This is the ground design of our framework.
In short: you can e.g. use the "Refresh" method inside a timer, at 500 ms.
It is how it works in our automated GUI classes (SQLite3Toolbar.pas).

We have added to the official project road-map a feature named "interface-based callbacks for Event Collaboration".
See http://blog.synopse.info/post/2012/09/0 … laboration
This is exactly what you need.
It is planned for the upcoming 1.18 release.
Stay tuned!

Offline

Board footer

Powered by FluxBB