Declares a durable operation; attach its handler factory with withDurableHandler.
const Counter = Operation.makeDurable({ key: 'example.counter', input: Schema.Number, output: Schema.Number, services: [] }).pipe( Operation.withDurableHandler((ctx) => Effect.succeed({ onInput: (input) => Effect.sync(() => ctx.submitOutput(input + 1)) }), ),); Copy
const Counter = Operation.makeDurable({ key: 'example.counter', input: Schema.Number, output: Schema.Number, services: [] }).pipe( Operation.withDurableHandler((ctx) => Effect.succeed({ onInput: (input) => Effect.sync(() => ctx.submitOutput(input + 1)) }), ),);
Declares a durable operation; attach its handler factory with withDurableHandler.