[Lazarus] TAChart question
José Mejuto
joshyfun at gmail.com
Sat Oct 2 01:33:40 CEST 2010
On 10/1/2010 08:11, Michael Van Canneyt wrote:
> On Fri, 1 Oct 2010, Michael Schnell wrote:
>
>> On 10/01/2010 02:22 PM, Michael Van Canneyt wrote:
>>>
>>> ExtJS has no such mechanism to my knowledge, but I'm not a reference.
>>
>> last time I checked some months ago it was said to be a new feature,
>> but should work, even though I did not find anybody who has tested it.
>>
>>>
>>>> This is necessary to overcome the asymmetry of the http protocol.
>>>>
>>>> IMHO "Server-Events" are necessary to design a CGI program with some
>>>> complexity.
>>>
>>> Well, I create seriously complex applications. No such mechanism was
>>> necessary till now.
>>
>> Hmm, How to do notify the user that the server has finished complex
>> work in the background without blocking the interface and/or creating
>> excessive http polling traffic ?
>
> Define excessive polling ?
>
>> An easy to do (non complex) example for a good application for such a
>> method is a server that allows tow client to chat.
>>
>>>
>>>> Moreover "server-Internal-Events" like from Timers, serial or
>>>> "direct" TCP/IP communication, thread-notification, ... are very
>>>> desirable and should be able to fire "server-events" towards the
>>>> client.
>>>
>>> Why ? What could you possibly need to do that the server needs to
>>> contact
>>> the client ? Everything you need can be programmed in the client, in my
>>> experience.
>>
>> Above trivial example ("chat server")
>>
>> Real-world: Imagine an "embedded" program automatically working with
>> some hardware interfaces and/or serial and/or TCP/IP connections. Now
>> you want to provide it with a "web" interface that allows a "user" to
>> connect to it and do configuration and monitoring. For monitoring this
>> method is essential: many "states" in the program permanently change
>> due to the work of the program and the external situation. These state
>> changes need to be shown in the remote browser with low latency and
>> without excessive communication overhead.
>
> In my experience: keeping a connection open IS excessive communication
> overhead and very unreliable to boot.
>
> I thought like you, 12 years ago. Till reality kicked in. Faulty switches,
> company firewalls and whatnot. Not all servers/firewalls support HTTP 1.1
> (for a persistent connection) etc. Too many problems.
>
> So you end up with polling anyway. 10 polls per second is enough to fool
> the
> human eye and doesn't stress the server too much.
>
> Michael.
Aren't ExtJS Ajax calls asynchronous? The JavaScript code continues
after firing a call to the server. There is a "callback" event that we
can use when the server sent the reply back (and process success/failure
events on the call).
At least I had to do some things to NOT give back the control to the
user over the client side until the response arrives from the FPC server
CGI/FCGI app (like disabling all controls for example).
IMO Exjs and FPC/Lazarus works superbly (you need FPC and Lazarus from
the trunk SVN at the moment for it). You do not need ExtPascal at all.
AB
More information about the Lazarus
mailing list