Skip to content

Consider interop between retry.__ suite and possible retryable(fn, params) signature #97

@parzhitsky

Description

@parzhitsky

Interesting: currently, the retry() function accepts an action parameter, which is a function with promise-constructor-executor-like signature:

// roughly
type Action = <Result>(resolve: Function, reject: Function, retry: Retrier) => Promise<Result>;
// roughly
type Executor = <Result>(resolve: Function, reject: Function) => Promise<Result>;

This means, that it would be backward compatible to provide those params as the second argument of retry(), as in:

const result = await retryable(db.connect, { retryDelay: ... });

… which frankly should've been the first choice of the function signature.

Originally posted by @parzhitsky in #96 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: meta[Issue / PR] describes change in the development process, documentation, maintenance etc.Priority: high[Issue / PR] must be addressed as soon as possibleType: investigation[Issue / PR] addresses the need of gaining intel

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions