import { EventEmitter } from "events" ; import { IContext , IDocumentLambdaServerConfiguration , IPartitionConfig , IPartitionLambda , IPartitionLambdaFactory , } from "@fluidframework/server-services-core" ; import { DocumentLambda } from "./documentLambda" ; export class DocumentLambdaFactory extends EventEmitter implements IPartitionLambdaFactory < IPartitionConfig > { constructor ( private readonly documentLambdaFactory , private readonly documentLambdaServerConfiguration ) { super ( ) ; this . documentLambdaFactory . on ( "error" , ( error ) => { this . emit ( "error" , error ) ; } ) ; } public async create ( config , context ) { return new DocumentLambda ( this . documentLambdaFactory , config , context , this . documentLambdaServerConfiguration ) ; } public async dispose ( ) { await this . documentLambdaFactory . dispose ( ) ; } }