Skip to content

setup middleware pipeline for Ruby request adapter #1650

Closed

Description

related #120
related #635

To implement cross cutting concerns (like retrying on transient errors) we need the current http client to support middleware handlers, that is intercepting and change the request before it's sent over the wire, and the response before it's returned to the caller.

The first step here is to check the documentation of the client we're currently using to see whether it supports two things:

  • Defining and injecting middleware handlers in the requests execution pipeline
  • Defining and attaching request options to the request object (to be picked up by a middleware handler)

If it doesn't, we should design an overhead API for the native client that offers similar methods prototypes (what we did with TypeScript & fetch).

Additionally:

  • the abstractions needs to have a middleware request option interface defined
  • we need a client factory in the http library so consumers can get a client with the same middleware configuration as the request adapter is using by default.
  • the request information type needs to be able to carry request options
  • the options property property on request configuration needs to be of this new type (update the refiner)
  • generator method needs to pass the options to the request information object
  • the request adapter implementation needs to pass these options to the native request object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions