Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 325121 - provide progress while loading Resource
Summary: provide progress while loading Resource
Status: RESOLVED WONTFIX
Alias: None
Product: EMF
Classification: Modeling
Component: Core (show other bugs)
Version: 2.6.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Ed Merks CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 321689
  Show dependency tree
 
Reported: 2010-09-13 10:50 EDT by Nicolas Bros CLA
Modified: 2012-10-05 01:12 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Bros CLA 2010-09-13 10:50:48 EDT
Currently, there doesn't seem to be any way to follow the progress while loading a Resource. ResourceSet#getResource is blocking until the Resource is fully loaded.

It would be useful to be able to receive notifications as the Resource is being loaded, for example through some sort of listener or callback mechanism, to be able to display a progress bar.
Comment 1 Ed Merks CLA 2010-09-16 17:04:18 EDT
I'm not sure what kind of useful progress could be reported.  It would certainly need to be up to each individual type of resource do implement such a thing, e.g., XMLResourceImpl... Generally resources load so quickly I'm not sure a human being would derive anything useful from dozens of updates happening in the course of a few seconds.  What would be useful to report and wouldn't be produced in such volumes so as to add significantly to the overall time of loading?
Comment 2 Nicolas Bros CLA 2010-09-17 03:39:49 EDT
Maybe the InputStream (in XMLLoadImpl) could be used (when loading a XMLResourceImpl) to know how many bytes have been read so far. By comparing this to the size of the file, we can get a percentage that can be reported back to the caller through a listener or callback.

To avoid slowing down the loading process by sending too many notifications, we can send only significant changes, for example every 1%, or every megabyte read.
Comment 3 Ed Merks CLA 2012-10-05 01:12:17 EDT
It all sounds complicated and invasive.  Much of the loading is done when proxies are resolved in which case there's little opportunity for displaying progress.