mirror of
https://github.com/Effect-TS/effect.git
synced 2026-12-04 03:35:36 +08:00
fix(cluster): propagate abandonment to the RPC requester
This commit is contained in:
@@ -1285,10 +1285,18 @@ const make = Effect.gen(function*() {
|
||||
readonly context?: Context.Context<never>
|
||||
}) {
|
||||
const context = options?.context ? Context.merge(options.context, address) : address
|
||||
return client.client(tag, payload, {
|
||||
const response = client.client(tag, payload, {
|
||||
...options,
|
||||
context
|
||||
})
|
||||
// RpcClient relays write-fiber failures as causes. Restore abandonment
|
||||
// on the requester before user recovery, without overriding its mask.
|
||||
return Effect.isEffect(response)
|
||||
? Effect.onError(
|
||||
response,
|
||||
(cause) => ClusterAbandon.isCause(cause) ? ClusterAbandon.interrupt : Effect.void
|
||||
)
|
||||
: response
|
||||
}
|
||||
const proxyClient: any = {}
|
||||
return new Proxy(proxyClient, {
|
||||
|
||||
Reference in New Issue
Block a user