You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if this is discussed before. Can ssh2 support AbortController so certain operations can be cancellable due to say timeout?
Currently I implemented a timeout before invoking FastGet. But while the main app timeout the operation (do not wait for it to finish), I believe FastGet actually is still running. So I am looking for a way to cancel the operation when timeout, without terminating the connection. The advantage is I can reduce unnecessary bandwidth usage, and clean up the file without the file being locked.
Thanks for your time.
The text was updated successfully, but these errors were encountered:
// Abort if onstep returns true
if (onstep && onstep(total, nb, fsize)) {
return onerror(new Error('Cancelled by user'));
}
Then you could use the following (application code) to cancel fastGet()/fastPut() mid-transfer.
var opts = {
step: (transferred, chunk, total)=>{
if (canceled())
return true;
}
};
fastGet(..., opts);
But could be a breaking change if someone's incorrectly returning a value from step(), though.
It would also be handy to expose fastXfer() in the public API, so you can copy files between ftp servers. fastGet/Put() only work local->remote or remote->local, but sometimes you may need to do remote->remote.
Not sure if this is discussed before. Can ssh2 support AbortController so certain operations can be cancellable due to say timeout?
Currently I implemented a timeout before invoking FastGet. But while the main app timeout the operation (do not wait for it to finish), I believe FastGet actually is still running. So I am looking for a way to cancel the operation when timeout, without terminating the connection. The advantage is I can reduce unnecessary bandwidth usage, and clean up the file without the file being locked.
Thanks for your time.
The text was updated successfully, but these errors were encountered: