Giter Site home page Giter Site logo

andrewmacmurray / elm-concurrent-task Goto Github PK

View Code? Open in Web Editor NEW
34.0 34.0 5.0 679 KB

Run a tree of Tasks concurrently, call JS functions as Tasks (Task Ports).

Home Page: https://package.elm-lang.org/packages/andrewMacmurray/elm-concurrent-task/latest/

License: MIT License

Elm 88.09% TypeScript 10.57% JavaScript 1.21% Shell 0.13%
concurrency elm task-ports

elm-concurrent-task's People

Contributors

andrewmacmurray avatar choonkeat avatar supermario 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

Watchers

 avatar  avatar

elm-concurrent-task's Issues

Copy API from `Time`

How do you feel about the idea of copying the API from elm/time inside ConcurrentTask.Time?

The idea is that then you can import ConcurrentTask.Time as Time and just use it as if it were the normal Time module.

Http Bytes compatibility

It would be nice to make the ConcurrentTask.Http module compatible with elm/bytes.

A popular way seems to be encoding / decoding a Base64 string with a package like this. This however loses most of performance gains of using Bytes.

I'd be curious if anyone has any opinions / alternatives to this.

Multiple pools per ports

Currently it's assumed that you'd use 1 task pool per pair of ports.

However, this is not the case with something like a nested TEA single page app, where it makes sense to have a task pool per page. It's unsafe currently to do this:

  • A task is in-flight from one pool (say internally it has an attempt id of 0).
  • The user switches pages and immediately starts a task.
  • The attempt ids would overlap and there would likely be a weird race condition.

A possible solution would be to add ConcurrentTask.namedPool where you could give a pool a unique name / id - this would prevent race conditions as the runner would know which task pool the responses are associated with.

There may be a way for the pool to initially generate a random id internally before it does any work, but would have to experiment with that and hopefully not break the types

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.