You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I feel like its really common that one host service uses reqwest to communicate with another as its the most popular http client. It prohibits a lot of the use cases of using turmoil for simulating service to service communication as its annoying to replace it with a plain http connector like in the axum example.
But looking at seanmonstar/reqwest#2496 inspired me to look into making it happen with a regular looking reqwest::Client.
And it works! It is unsound as it relies on the vtable layout of a sealed trait being the same as my user defined trait but as long as the internal trait stays the same it should work.
The code is similar to the fake client from the axum example with the wrapper io type:
Yeah I think that's what they are going for with the connector_layer function they are just unsure about what they want to expose to the api. There was some discussion about it in PR I linked that added it. Maybe we will get a nice API for it in the future
I feel like its really common that one host service uses
reqwest
to communicate with another as its the most popular http client. It prohibits a lot of the use cases of using turmoil for simulating service to service communication as its annoying to replace it with a plain http connector like in the axum example.But looking at seanmonstar/reqwest#2496 inspired me to look into making it happen with a regular looking
reqwest::Client
.And it works! It is unsound as it relies on the vtable layout of a sealed trait being the same as my user defined trait but as long as the internal trait stays the same it should work.
The code is similar to the fake client from the axum example with the wrapper io type:
Should I create an example for this? Or is this too hacky?
The text was updated successfully, but these errors were encountered: