Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progress callback for SendObject and GetObject #153

Open
ganeshrvel opened this issue Oct 23, 2020 · 6 comments
Open

Progress callback for SendObject and GetObject #153

ganeshrvel opened this issue Oct 23, 2020 · 6 comments

Comments

@ganeshrvel
Copy link

I am trying to upload/download files using MTP but I couldn't find any callbacks for receiving the progress.

Is there a way to get the progress information for SendObject and GetObject?

@hanwen
Copy link
Owner

hanwen commented Nov 4, 2020

not currently.

@ganeshrvel
Copy link
Author

Could you suggest me a way to get the progress information?

What files or functions should I work on to get the file transfer progress?

@hanwen
Copy link
Owner

hanwen commented Nov 4, 2020

are you using FUSE or just the MTP part ? what kind of progress do you want (console, graphics)? Should it be timed (every 100ms) or by throughput (say every 100kb)?

The easiest is probably to insert somehting in bulkRead/bulkWrite (mtp.go). That doesnt cover the request/response metadata, though.

@ganeshrvel
Copy link
Author

are you using FUSE or just the MTP part
I am using mtp package for building a application library. Not using FUSE whatsoever

what kind of progress do you want (console, graphics)
it's not a console program, so just progress values should do fine.

Should it be timed (every 100ms) or by throughput (say every 100kb)
timed

The easiest is probably to insert somehting in bulkRead/bulkWrite (mtp.go). That doesnt cover the request/response metadata, though.
So I suppose I will have to split the object into chunks and send them.

I have a question in that case: how do I get the timed progress? I don't see any callback functions for the same.

Thanks

@hanwen
Copy link
Owner

hanwen commented Nov 5, 2020

the MTP library already does the chunking. You just have to add a callback there. If you want timed output, add
a GetCount() uint64 function and call that on a timer while the transaction is running.

@ganeshrvel
Copy link
Author

Got it. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants