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
Since this module primarily does I/O, it would be good to support an event loop.
I've made the resumable upload method upload_file_content_iterator() for this purpose, but it doesn't help that everything else is done with synchronous requests, including the preliminary request that is required for this method (create_resumable_upload() or create_resumable_upload_for()).
I can think of several ways to try and support event loops:
We can switch to an event loop. My money is on IO::Async since it works with other loops and its author is active and friendly.
Same as No. 1 but make it optional, like a setting or a detection.
We can come up with a simple way to subclass the http_loop() method so people can create their own variations.
We can have a parameter for the http_loop() that makes it easy to hook up another event loop (this is tricky)
We can make the request a hook instead, so people can provide a callback for handling requests (this is also tricky)
We can add an optional callback for every operation and set the default to what we would do with it
Switch everything to Promises or Futures and allow the user to trigger the call
I haven't yet looked enough into it to decide which approach is best but I'm inclined to go with No. 7 since it provides the cleanest interface for handling sync and async by making everything a Future that is either satisfied immediately (sync) or later (async) by whatever event loop you are using. Future.pm has clean interfaces for many event loops and you can always add your own easily.
The text was updated successfully, but these errors were encountered:
Since this module primarily does I/O, it would be good to support an event loop.
I've made the resumable upload method
upload_file_content_iterator()
for this purpose, but it doesn't help that everything else is done with synchronous requests, including the preliminary request that is required for this method (create_resumable_upload()
orcreate_resumable_upload_for()
).I can think of several ways to try and support event loops:
IO::Async
since it works with other loops and its author is active and friendly.http_loop()
method so people can create their own variations.http_loop()
that makes it easy to hook up another event loop (this is tricky)I haven't yet looked enough into it to decide which approach is best but I'm inclined to go with No. 7 since it provides the cleanest interface for handling sync and async by making everything a Future that is either satisfied immediately (sync) or later (async) by whatever event loop you are using.
Future.pm
has clean interfaces for many event loops and you can always add your own easily.The text was updated successfully, but these errors were encountered: