Skip to content
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

ByteStream became a final class in http 1.1.0 #5

Open
ninogjoni opened this issue Aug 5, 2023 · 0 comments
Open

ByteStream became a final class in http 1.1.0 #5

ninogjoni opened this issue Aug 5, 2023 · 0 comments

Comments

@ninogjoni
Copy link

I've noticed that 'betamax' relies on an older version of the 'http' package. I also observed that there might not have been any updates to this package for approximately 17 months.

Given the absence of recent updates, I took the initiative to fork 'betamax' and tried to update the 'http' package myself.
I discovered that starting from version 1.1.0, the ByteStream in the 'http' package has become a final class and can no longer be extended like here:

class RepeatableByteStream extends ByteStream {
  RepeatableByteStream(Stream<List<int>> stream) : super(stream) {
    // Set up a subscription on the inner stream, and rebroadcast all events
    // to the listeners.
    _innerSubscription ??= super.listen(
      (List<int> bytes) {
        _innerStreamBytes.addAll(bytes);
        _listenerControllers.addEvent(bytes);
      },
      onError: (Object e, [StackTrace? st]) {
        _listenerControllers.addError(e, st);
      },
      onDone: () {
        _innerStreamDone = true;
        _listenerControllers.closeAll();
        _listenerControllers.clear();
      },
      cancelOnError: false,
    );
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant