GithubHelp home page GithubHelp logo

tornado's People

Contributors

b-viguier avatar e-zannelli avatar jdecool avatar matyo91 avatar oliboy50 avatar samnela avatar valentin-claras avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tornado's Issues

Handle "thenable" promises

To be able to use existing libraries returning "thenable" promises, we could add a method like

EventLoop::promiseFromThenable($thenablePromise): Promise

Up to each event loop implementation to deal with it.

Should we restrict thenable promises to React PromiseInterface 🤔 ?

Rethrow exceptions if promise is not yielded

It's very useful to launch an async function, and don't care about it's result/promise. But it can have a tricky side-effect, since exceptions will be stuck in the promise and never be propagated anywhere…

We could ensure that a "non yielded" promise will rethrow all exceptions when rejected.
See similar feature in Amp.

Notes 🤔 :

  • What about rejected promises? They shouldn't throw an exception at creation…
  • How to explicitly indicates that we don't care about exceptions for a particular promise? Is it easy to try/catch all?

Exception handling

Currently, any exception thrown by an adapter is propagated to upper context outside of Tornado. It means that if you intend to catch a particular exception, it may be broken as soon as you change the used adapter.

Proposal:

  • Catch underlying exceptions and translate them in "Tornado exceptions" (to be created)
  • Use @throws annotation to document this behavior and improve developer experience with IDE

HttpClientTest agnostic from Guzzle

Currently, the HttpClientTest mock network calls by passing a GuzzleMockAdapter to the createHttpClient function. But this function should stay generic, and don't assume that underlying client uses Guzzle.

A better approach could be to replace this parameter by an array of Psr\Http\Message\ResponseInterface to return. Underlying concrete test will be in charge of instancing its own mock.

EventLoop::promiseRace

See similar functions in ReactPhp and Amp (Amp does not have a similar helper).
This will allow to cancel a promise if needed.

/**
* Creates a promise that will behave like the first settled input promise.
**/
public function EventLoop::promiseRace(Promise ...$promises): Promise;

EventLoop:delay function

Add this new function in EventLoop interface, implement it in each adapter, write tests

/**
* Returns a promise that will be resolved with `null` after at least $milliseconds.
**/
public function EventLoop::delay(int $milliseconds): Promise;

Add README

A good introduction page:

  • What is Tornado
  • How to install
  • How to use it

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.