Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
intrn(server): initialize with request
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethTrecy committed Oct 15, 2022
1 parent 922a6dc commit c0cb5a7
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import type { AsynchronousRequest, BaseManagerClass } from "!/types/dependent"

import RequestFilter from "!/bases/request_filter"
import AsynchronousOperationManager from "!/singletons/asynchronous_operation_manager"

export default class AsynchronousOperationInitializer extends RequestFilter {
private managerClass: BaseManagerClass
private totalStepCount: number

constructor(managerClass: BaseManagerClass, totalStepCount: number) {
super()
this.managerClass = managerClass
this.totalStepCount = totalStepCount
}

async filterRequest(request: AsynchronousRequest): Promise<void> {
request.asynchronousOperation = new AsynchronousOperationManager()

await request.asynchronousOperation.initializeWithRequest(
request,
this.managerClass,
this.totalStepCount
)
}
}

0 comments on commit c0cb5a7

Please sign in to comment.