by guenter » 02 May 2008, 11:49
Since HTTPClientSession uses a stream to upload data, all you have to do is put notifications about progress in between your write operations. A possible way would be to use Task and TaskManager, which provide a simple notification mechanism for task progress. An issue in GUI applications is always getting things such as progress information from background threads to the GUI thread. A pattern that works well is to put all notifications into a NotificationQueue, and then, in the GUI thread's onIdle event/callback/etc., get the notifications from the queue and process them (e.g., update the progress bar). If you use Task and TaskManager, you should be able to register a NotificationQueue with the TaskManager as an observer, so that all notifications coming from tasks end up in the queue.