-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
How can I implement the Lock/Unlock mechanism with version 5+ #2014
Labels
s: best practise
It's the best way to do something so far
Comments
AlexV525
added
e: documentation
Improvements or additions to documentation
p: dio
Targeting `dio` package
labels
Oct 31, 2023
Pseudo flow:
|
@AlexV525 This is my implementation:
|
Some suggestions about your implementation:
|
AlexV525
added
s: best practise
It's the best way to do something so far
and removed
s: feature
This issue indicates a feature request
e: documentation
Improvements or additions to documentation
p: dio
Targeting `dio` package
labels
Nov 10, 2023
@AlexV525 Regarding (2), in my code I have flags to enable/disable interceptors, so I took it from there. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Request Statement
@cfa
I have a really significant use of the lock/unlock mechanism that was in the old versions (below 5.0.0),
mainly for use when the Internet connection disconnects and comes back, among other things.
For example with the use of the Queue package (but not only):
So requests are waiting to be sent until the connection returns, and meanwhile the Futures in the Queue are waiting and so is Queue.onComplete.
I looked for different Interceptors to meet this need and none perform the operation performed by the lock/unlock mechanism (which is of course based on the Lock class that was found in the interceptor.dart file)
I would like to know how I can implement this mechanism also in the new versions (5+)
or if it is still possible to return this mechanism?
(I didn't understand why it was removed in the first place)
Thanks in advance
The text was updated successfully, but these errors were encountered: