Skip to content

Inconsistency in method names for lambda and http server #46

@slinkydeveloper

Description

@slinkydeveloper

To create a restate server:

export const handler = restate
   .createServer()
   .bindService({
      service: "MyService",
      instance: new myService.MyServiceImpl(),
      descriptor: myService.protoMetadata,
    })
   .listen(8000);

To create a lambda function:

export const handler = restate
   .lambdaApiGatewayHandler()
   .bindService({
      service: "MyService",
      instance: new myService.MyServiceImpl(),
      descriptor: myService.protoMetadata,
    })
   .create();

Note the difference between restate.createServer() and restate.lambdaApiGatewayHandler(). Perhaps name restate.lambdaApiGatewayHandler() as restate.createLambdaApiGatewayHandler() and rename the final method create() as handle() or listen() or register() or start() or similar (just to avoid the confusion with the create used before)?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions