(
this: AnyWithProps,
fields: any,
opts?: { readonly discard?: Discard } | undefined
)
| 341 | }) |
| 342 | }, |
| 343 | execute<const Discard extends boolean = false>( |
| 344 | this: AnyWithProps, |
| 345 | fields: any, |
| 346 | opts?: { readonly discard?: Discard } | undefined |
| 347 | ) { |
| 348 | return Effect.suspend(() => { |
| 349 | const payload = this.payloadSchema.make(fields) |
| 350 | return Effect.flatMap( |
| 351 | EngineTag, |
| 352 | (engine) => |
| 353 | Effect.flatMap(makeExecutionIdFromPayload(this, payload), (executionId) => |
| 354 | Effect.andThen( |
| 355 | Effect.annotateCurrentSpan({ executionId }), |
| 356 | engine.execute(this as any, { |
| 357 | executionId, |
| 358 | payload, |
| 359 | discard: opts?.discard, |
| 360 | suspendedRetrySchedule: this.suspendedRetrySchedule |
| 361 | }) |
| 362 | )) |
| 363 | ) |
| 364 | }).pipe( |
| 365 | Effect.withSpan( |
| 366 | `${this._tag}.execute`, |
| 367 | {}, |
| 368 | { captureStackTrace: false } |
| 369 | ) |
| 370 | ) as any |
| 371 | }, |
| 372 | poll(this: Workflow<string, AnyStructSchema, Schema.Top, Schema.Top>, executionId: string) { |
| 373 | return Effect.flatMap(EngineTag, (engine) => engine.poll(this, executionId)).pipe( |
| 374 | Effect.withSpan(`${this._tag}.poll`, { attributes: { executionId } }, { captureStackTrace: false }) |
no test coverage detected