![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@convoyr/plugin-retry
Advanced tools
> A retry plugin for [Convoyr](https://github.com/jscutlery/convoyr).
A retry plugin for Convoyr.
This plugin retries failed network requests using a configurable back-off strategy.
The plugin requires @convoyr/core
and @convoyr/angular
to be installed.
yarn add @convoyr/plugin-retry
or
npm install @convoyr/plugin-retry
The whole configuration object is optional.
import { ConvoyrModule } from '@convoyr/angular';
import { createRetryPlugin } from '@convoyr/plugin-retry';
@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
HttpClientModule,
ConvoyrModule.forRoot({
plugins: [createRetryPlugin()],
}),
],
bootstrap: [AppComponent],
})
export class AppModule {}
You can give a partial configuration object it will be merged with default values.
Property | Type | Default value | Description |
---|---|---|---|
initialIntervalMs | number | 300 | Duration before the first retry. |
maxIntervalMs | number | 10_000 | Maximum time span before retrying. |
maxRetries | number | 3 | Maximum number of retries. |
shouldRetry | RetryPredicate | isServerOrUnknownError | Predicate function to know which failed request should be retried. |
shouldHandleRequest | RequestCondition | () => true | Predicate function to know which request the plugin should handle. |
Here is an example passing a configuration object.
Keep in mind that HTTP error is not emitted while the plugin is retrying. In the following example the HTTP error will be emitted after 10 retries, then the observable completes.
import { MemoryStorage } from '@convoyr/plugin-cache';
@NgModule({
imports: [
ConvoyrModule.forRoot({
plugins: [
createRetryPlugin({
initialIntervalMs: 500,
maxIntervalMs: 20_000,
maxRetries: 10,
shouldRetry: (response) => response.status !== 404,
shouldHandleRequest: ({ request }) =>
request.url.includes('api.github.com'),
}),
],
}),
],
})
export class AppModule {}
FAQs
> A retry plugin for [Convoyr](https://github.com/jscutlery/convoyr).
The npm package @convoyr/plugin-retry receives a total of 0 weekly downloads. As such, @convoyr/plugin-retry popularity was classified as not popular.
We found that @convoyr/plugin-retry demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.