Skip to content

resolve router async #207

@katzIdo

Description

@katzIdo

General description

a router is a sync function that retrieves endPoint from the registry.

if it doesn't find any endpoint then it returns null.

changing the router to be async will mean that normal routers will resolve immediately with null or endPoint.

but now, it will be possible to create routers that will be able to wait until the endPoint is available.

API

Design proposition

A clear and concise description of the design proposition.

  • Is backward compatible

  • Changes existing API

Pull Request

[Link]

Old API

Code snippet

export type Router = (options: RouterOptions) => Endpoint | null;

New API

Code snippet

export type Router = (options: RouterOptions) => Promise<Endpoint>;

Test cases

all old tests should pass.

router tests should be modified to run async

Ready for implementation

  • API has been approved

  • Test cases have been prepared

  • Discussed with Technical lead

Definition of Done

  • Developer review

  • All tests are implemented

  • Documentation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions