Code Monkey home page Code Monkey logo

Comments (6)

pushrsp avatar pushrsp commented on May 20, 2024

@minwoox , can i work on it?

from armeria.

minwoox avatar minwoox commented on May 20, 2024

Hi, @pushrsp! Yeah, you can have this. Thanks!

from armeria.

pushrsp avatar pushrsp commented on May 20, 2024

Hi, @pushrsp! Yeah, you can have this. Thanks!

@minwoox, I'm gonna try to fix it like this below:
Screenshot 2024-04-01 at 4 26 21 PM

Does it look good to you?

from armeria.

minwoox avatar minwoox commented on May 20, 2024

We also have to cancel the publisher that emits the data.
I highly recommend you read some articles about Reactive Streams. e.g. https://engineering.linecorp.com/en/blog/reactive-streams-armeria-1

from armeria.

pushrsp avatar pushrsp commented on May 20, 2024

As far as I know, If tryWrite is failed, it means that WebSocketWriter is already closed.
So, What kind of exception should be thrown?
Or just use write instead of tryWrite because in try, it throws ClosedStreamException if WebSocketWriter is closed, so let exception handler in ExecutionResultSubscriber.onNext() pick ClosedStreamException up and cleanup the resource.

from armeria.

minwoox avatar minwoox commented on May 20, 2024

If tryWrite is failed, it means that WebSocketWriter is already closed.

That is correct. 👍
Even though the writer is closed, the publisher still might be emitting the data.

streamMessage.subscribe(executionResultSubscriber, ctx.eventLoop());

So if tryWrite returns false, we should cancel the publisher not to emit the data anymore.

from armeria.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.