mirror of
https://github.com/whyour/qinglong.git
synced 2026-09-21 01:25:29 +08:00
24 lines
859 B
TypeScript
24 lines
859 B
TypeScript
import type { WorkerRemoteRunCompletionClient } from '../ports/workerRemoteRunCompletionClient';
|
|
import type { PrimaryRunCompletionResult } from './primaryRunCompletionService';
|
|
import {
|
|
RemoteRunCompletionService,
|
|
type RemoteRunCompletionCommand,
|
|
} from './remoteRunCompletionService';
|
|
import type { AuthenticatedWorkerPrincipal } from './workerControlService';
|
|
|
|
/** The transport authenticates once; Worker request bodies cannot select a principal. */
|
|
export class BoundWorkerRemoteRunCompletionClient
|
|
implements WorkerRemoteRunCompletionClient
|
|
{
|
|
constructor(
|
|
private readonly service: RemoteRunCompletionService,
|
|
private readonly principal: AuthenticatedWorkerPrincipal,
|
|
) {}
|
|
|
|
complete(
|
|
command: RemoteRunCompletionCommand,
|
|
): Promise<PrimaryRunCompletionResult> {
|
|
return this.service.complete(this.principal, command);
|
|
}
|
|
}
|