Closed rgplvr closed 1 year ago
Hello, thanks for the PR. It seems there is an issue with the CI, looks like a breaking change in one of the dependencies of multipack. I'll try to fix it.
Support for cancellation in Dio is good, but is passing a signal cancel token for all requests of the link the right approach?
You can only cancel the token once, right?
I think a better solution would be to pass the cancel token via the context. Then the client code could either create a new cancel token for each request or re-use the same token for multiple requests if preferred.
See e.g. https://github.com/gql-dart/gql/blob/master/links/gql_dio_link/lib/src/dio_link.dart#L312
class DioLinkCancelTokenContextEntry extends ContextEntry {
final CancelToken token;
...
}
in DioLink:
...
final cancelToken = request.context.entry<DioLinkCancelTokenContextEntry>();
...
Makes sense. I have made the changes to push the cancellation token to the context entry.
please update your branch from master to fix the ci issues
done
made the changes the source is properly formatted as per the diff
Thanks, LGTM
allow cancellation of call using dio cancellation