Git Product home page Git Product logo

maxfierke / ember-concurrency-retryable Goto Github PK

View Code? Open in Web Editor NEW
23.0 2.0 2.0 6.16 MB

An Ember addon that adds retry strategies and a task modifier for automatically retrying ember-concurrency tasks.

Home Page: https://maxfierke.github.io/ember-concurrency-retryable

License: MIT License

JavaScript 93.22% HTML 3.70% CSS 0.39% Handlebars 2.69%
ember-concurrency retry-policy sometimes-computers-suck

ember-concurrency-retryable's Introduction

ember-concurrency-retryable

Build Status npm version Ember Observer Score

An Ember addon that adds retry strategies and a task modifier for automatically retrying ember-concurrency tasks.

Compatibility

  • Ember.js v3.16 or above
  • Ember CLI v3.16 or above
  • ember-concurrency 2.2.0+

Installation

ember install ember-concurrency-retryable

Documentation

https://maxfierke.github.io/ember-concurrency-retryable

Contributing / Reporting Issues

See the Contributing guide for details.

License

This project is licensed under the MIT License.

Thanks

ember-concurrency-retryable's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar ember-tomster avatar maxfierke 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

Watchers

 avatar  avatar

ember-concurrency-retryable's Issues

Off-By-One Error in Delay

Thanks for the great addon!

I believe there's an off-by-one error in the DelayPolicy. The first retry takes the time at position 1 in the array, and the last retry happens more or less immediately since delay[delay.length] is undefined. If you look at this test, the first retry happens after 200ms, the second after 300ms, and the last immediately. I put some logging in to test this.

screen shot 2019-02-28 at 6 19 50 pm

screen shot 2019-02-28 at 6 22 19 pm

.retryable is not a function

Hi, I get this error in console:

Error while processing route: index (0 , _emberConcurrency.task)(...).enqueue(...).maxConcurrency(...).retryable is not a function TypeError: (0 , _emberConcurrency.task)(...).enqueue(...).maxConcurrency(...).retryable is not a function

task modifiers look like this: .enqueue().retryable(backoffPolicy)

ember-concurrency-retryable seems to be correctly installed because backOffPolicy has a value.

using Ember 3.2.2

Awkward use with infinite-looping tasks

For looping tasks (e.g. those with while(true) { ... }), if the task is retried successfully, the next time it fails, it will only be retried if there are available delays left in the policy (in the context of DelayPolicy-based policies). This seems counter-intuitive, so it should probably be changed so that successfully retrying the task clears the slate. There may be some instances where that wouldn't be the desired behavior, but that seems outside of the typical use-case and should be implemented in a custom policy.

Use the public APIs exposed in e-c PR

This ember-concurrency PR moved around some internals (preserving the old names w a deprecation warning in cases where I know addons such as this made use of private/intimate API).

When you have a sec, could you run against this PR and fix any imports to private APIs and let me know if I missed anything?

How to use ember-concurrency-retryable with the decorators provided by ember-concurrency?

Thanks a lot for this wonderful addon! I am in process of upgrading my code to the latest version of Ember and ember-concurrency. For Eg., Am changing the tasks from:

setupTask: task(function * () {}).drop()

to:

@dropTask *setupTask() { };

How does this work in case of retryable tasks? Any pointers on how to migrate the following code to be compliant with the latest Ember concurrency will be much appreciated!

fooTask : retryable(task(function * () {
   .....
}).drop().evented(), retryPolicy);

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.