question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[IDEA] Implement progress callbacks

See original GitHub issue

It is a very good aspect of the UI to deliver users with updates regarding the process, if the operation is something that takes a while. There are certain operations in fsspec that are like blackboxes. You don’t know anything until those are completed. I’d propose we add a callback system for certain APIs, so that client code can show progress bars, take action depending on those etc. etc.

Here is the list of APIs that might be helpful with progress bars;

  • get_file/put_file => A progress bar showing the full size of the remote file, and the current download/update status.
  • get/put/cat => Total number of files that are going to be transferred, and the current cursor (like 2 of 16 files are transffered)

There are also possibilities for other APIs (e.g ls/find) to implement such callbacks, if they take a long time.

Callbacks are totally optional, and no file system is expected to implement all of them for their all APIs. Also the callback system should be abstracted to level where they are totally separate from the actual logic in the client code.

Here is the implementation that I’ve drafted (though I know it is a huge change, so it can drastically evolve): https://github.com/intake/filesystem_spec/compare/master...isidentical:progress?expand=1

Comments would be appreciated.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:19 (18 by maintainers)

github_iconTop GitHub Comments

3reactions
isidenticalcommented, Jun 10, 2021
2reactions
isidenticalcommented, Jun 22, 2021

Please correct me if I’m wrong, but another thing is that currently sshfs only provides an ssh filesystem, while fsspecs is pure sftp and for some use cases that might make sshfs not work

Though all operations currently supported is already using SFTP under the hood in sshfs, so there wouldn’t be any breakage on that front. Only the new methods (cp_file/checksum, and in some rare cases move() [but those would result with an error in the existing SFTPFileSystem]) does command execution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Best strategy for reporting progress to the UI - how should the ...
You can always implement here your progress callback in form byte of bytes, and hold all comunication control over http is very commonly ......
Read more >
Is it possible to use object methods as callbacks?
Starting in OpenEdge 12.2, the SET-CALLBACK method was implemented for the socket SET-READ-RESPONSE-PROCEDURE functionality.
Read more >
c# - Algorithm progress callback - Stack Overflow
I would like to know what is the best approach to implement progress callback. I na future I would like to use this...
Read more >
Ideas, Solutions, Work in progress
This blog will show how to drastically reduce the code and how to turn the callback handlers into observables.
Read more >
Callbacks — Stable Baselines3 1.7.0a10 documentation
You can use callbacks to access internal state of the RL model during training. It allows one to do monitoring, auto saving, model...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found