mirror of
https://github.com/whyour/qinglong.git
synced 2026-09-21 01:32:44 +08:00
38 lines
1.3 KiB
TypeScript
38 lines
1.3 KiB
TypeScript
import type {
|
|
AcknowledgeRemoteRunRunningCommand,
|
|
AcknowledgeRemoteRunStartingCommand,
|
|
FailRemoteRunStartCommand,
|
|
RemoteRunActivationResult,
|
|
} from './remoteRunActivationService';
|
|
import { RemoteRunActivationService } from './remoteRunActivationService';
|
|
import type { AuthenticatedWorkerPrincipal } from './workerControlService';
|
|
import type { WorkerRemoteRunActivationClient } from '../ports/workerRemoteRunActivationClient';
|
|
|
|
/** The transport authenticates once; Worker request bodies cannot select a principal. */
|
|
export class BoundWorkerRemoteRunActivationClient
|
|
implements WorkerRemoteRunActivationClient
|
|
{
|
|
constructor(
|
|
private readonly service: RemoteRunActivationService,
|
|
private readonly principal: AuthenticatedWorkerPrincipal,
|
|
) {}
|
|
|
|
acknowledgeStarting(
|
|
command: AcknowledgeRemoteRunStartingCommand,
|
|
): Promise<RemoteRunActivationResult> {
|
|
return this.service.acknowledgeStarting(this.principal, command);
|
|
}
|
|
|
|
acknowledgeRunning(
|
|
command: AcknowledgeRemoteRunRunningCommand,
|
|
): Promise<RemoteRunActivationResult> {
|
|
return this.service.acknowledgeRunning(this.principal, command);
|
|
}
|
|
|
|
failStart(
|
|
command: FailRemoteRunStartCommand,
|
|
): Promise<RemoteRunActivationResult> {
|
|
return this.service.failStart(this.principal, command);
|
|
}
|
|
}
|