Giter Site home page Giter Site logo

Make the SqsStream infinite about zio-sqs HOT 2 CLOSED

zio avatar zio commented on July 30, 2024
Make the SqsStream infinite

from zio-sqs.

Comments (2)

ghostdogpr avatar ghostdogpr commented on July 30, 2024

I think it makes sense to have this option in addition to the existing one. To be consistent with Producer I think it would be good to mimic methods that do not fail the operation but return ErrorOrEvent[T] (defied as Either[ProducerError[T], ProducerEvent[T]]), in particular sendStreamE.

from zio-sqs.

melgenek avatar melgenek commented on July 30, 2024

I implemented the proposal and it doesn't seem to be reasonable to me any more 🙂.

Returning Either[Throwable, Message.ReadOnly] would mean that the next request to sqs follows the failed one without giving any time to the system to recover. So in my example, the dns issue can last some seconds or minutes and the stream would be flooded with Left values. This can cause performance issues, the monitoring and logging systems will be full of errors etc.

The better approach for my desire of having an infinite stream is retiring the failed stream exponentially. The code would look like

SqsStream(???, ???)
      .runDrain
      .retry(Schedule.exponential(1.second) || Schedule.spaced(4.second) )

from zio-sqs.

Related Issues (19)

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.