(argument: A, context: JobHandlerContext<A, I, O>)
| 48 | |
| 49 | return (handler, options) => { |
| 50 | const newHandler = (argument: A, context: JobHandlerContext<A, I, O>) => { |
| 51 | const previous = latest; |
| 52 | latest = concat( |
| 53 | previous.pipe(ignoreElements()), |
| 54 | new Observable<JobOutboundMessage<O>>((o) => handler(argument, context).subscribe(o)), |
| 55 | ).pipe(shareReplay(0)); |
| 56 | |
| 57 | return latest; |
| 58 | }; |
| 59 | |
| 60 | return Object.assign(newHandler, { |
| 61 | jobDescription: Object.assign({}, handler.jobDescription, options), |