ahmed-negm / google-gdata

Automatically exported from code.google.com/p/google-gdata
0 stars 0 forks source link

AsyncOperationProgress reports the percentage for the previous step each time #308

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
When uploading with an async insert, I Get the progress report after each 
4096 chunk is sent. The percentage value is calculated after every event, 
instead of before the event.
in gauthrequest.cs file, line #685, I think the "current" increase should be 
before the "new AsyncOperationProgressEventArgs" call.

Also - is there a special reason why the constructors for new 
AsyncOperationProgressEventArgs are internal, so I can't create such event 
args myself, or inherit from it?

Original issue reported on code.google.com by ATGard...@gmail.com on 22 Dec 2009 at 7:14

GoogleCodeExporter commented 9 years ago
Fixed the calculation. No, there is no special reason for disallowing this. Why 
would
you want to do that? (the more i put external, the more i need to support until
retirement :)). 

Frank

Original comment by fman...@gmail.com on 4 Jan 2010 at 11:52

GoogleCodeExporter commented 9 years ago
I have created a CompositeOperation, that performs several requests one after 
the next, 
and I'd like to be able to raise an event containing "my" end results.
I know I can just create my own flavor of AsyncCompletedEventArgs, but since it 
would 
just contain pretty much what the AsyncOperationCompletedEventArgs class 
contains, I'd 
like to avoid that.

Original comment by ATGard...@gmail.com on 4 Jan 2010 at 11:57

GoogleCodeExporter commented 9 years ago
Curious: why aren't you using batch for that? From a performance perspective 
that should be a lot better? 

If you send me a patch for what you need public, i am happy to put it in.

Frank

Original comment by fman...@gmail.com on 4 Jan 2010 at 12:01

GoogleCodeExporter commented 9 years ago
So far I used CompositeOperation for multiple uploads and downloads. I'm pretty 
sure 
I can't get multiple streams from a batch operation. Not so sure about uploads 
- can 
I batch insert streams? It would make each request much bigger, anyway, 
containing 
all the streams together, so I think a sequential upload might be a better idea.

Another place I use Composite is for moving multiple documents into and out of 
multiple folders. I can only insert (or remove) multiple documents to a single 
folder 
URI, so my scenario needs several different requests. Also, for multiple file 
sharing 
to multiple users - each batch can only work on one file URI.

Original comment by ATGard...@gmail.com on 4 Jan 2010 at 12:11

GoogleCodeExporter commented 9 years ago
here is the patch.
It also requires that AsyncData and its derived classes be public.

Original comment by ATGard...@gmail.com on 4 Jan 2010 at 12:18

Attachments: