mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-07 04:12:10 +02:00
fix(ts): close effect native review blockers
This commit is contained in:
parent
b6759e75df
commit
a26463afc1
13 changed files with 438 additions and 528 deletions
|
|
@ -384,3 +384,17 @@ export function makeNatsBackend(url = "nats://localhost:4222"): PubSubBackend {
|
|||
}),
|
||||
};
|
||||
}
|
||||
|
||||
export const makeNatsBackendScoped = (url = "nats://localhost:4222") =>
|
||||
Effect.acquireRelease(
|
||||
Effect.sync(() => makeNatsBackend(url)),
|
||||
(backend) =>
|
||||
backend.close.pipe(
|
||||
Effect.catch((error) =>
|
||||
Effect.logError("[NatsBackend] Failed to close scoped backend", {
|
||||
error: error.message,
|
||||
operation: error.operation,
|
||||
})
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue