Giter VIP home page Giter VIP logo

futre_channel_in_rb's People

Contributors

cavinkwon avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

futre_channel_in_rb's Issues

Concurrent::Promise.execute 관련 질문이 있습니다!

일단 안정버전의

concurrent-ruby을 사용하여

api = ->param{ param == 4 ? raise : param }
jobs = 4.times.map{ |i| Concurrent::Promise.execute{ api.call(i) } }
Concurrent::Promise.zip(*jobs).value #=> [0, 1, 2, 3]

jobs = 5.times.map{ |i| Concurrent::Promise.execute{ api.call(i) } }
Concurrent::Promise.zip(*jobs).value #=> nil

위와 같은 결과를 얻을 수 있는데요,

Concurrent::Promise#zip의 [문서]에

Builds a promise that produces the result of promises in an Array and fails if any of them fails.

위와 같이 나와있는것을 확인하였습니다.

zip을 호출하면서 넘긴 *promises에 어떤것이라도 실패하면 zip의 리턴이 nil이 되는것 자체는 정상동작인것은 알겠는데,

제가 원하는건 exception이 발생하였더라도,

Concurrent::Promise.zip(*jobs).value #=> [0, 1, 2, 3, RuntimeError]

이런식으로라도.. 성공한 Promise의 value는 받고싶은데... 방법이 없을까요..?

써주신 문서의 에러 핸들링부분을 보면 concurrent-edge의 Concurrent.futureConcurrent.zip을 통해서 제가 원하는 결과가 보이긴 하는데

제가 원하는대로 하려면 concurrent-edge를 꼭 사용해야하나요? 안정버전에서는 방법이 없을까요?

좋은글 감사합니다.

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.