Closed jacobwgillespie closed 2 years ago
Thanks for the PR @jacobwgillespie. This looks great, and is a cool use case.
I got the same test failure locally, it looks the test believes clientcompat
is returning an empty string? Running clientcompat
directly did print the expected output.
Ah, I think I found my local issue - the test calls clientcompat
, which assumes it's installed globally. Changing it to const child = spawnSync("./clientcompat -client=./test", ...
works, though I assume that binary is only for macOS and wouldn't run in Actions.
Currently the output of stderr is /bin/sh: clientcompat: command not found
.
I can look into that failing test case. This PR looks great as is.
Yeah clientcompat
is a vendored go get
of https://github.com/twitchtv/twirp/tree/main/clientcompat
Hey! 👋
This PR adds the ability to provide an
rpcTransport
directly at a client call site, so that the client can be changed dynamically for that specific call:I'm using TwirpScript with Cloudflare Workers and am additionally using Twirp to communicate between Workers and Durable Objects. Durable Objects provide a custom
fetch
client for communicating with that specific object, so I need a way to dynamically choose the transport per call: