Closed tomerd closed 1 year ago
we could / should consider doing this on LambdaHander
instead of the new abstraction, also not in love with the "Simple" prefix.
We can drop context:
from LambdaHandler
’s initializer, then the SimpleLambdaHandler
model will just fit (we can keep async
and throws
so users can still initialize some resources if they want).
@stevapple context
is needed when users need to initialize resources, it provides thinks like NIO's EventLoop
and Terminator
, so we cannot just drop it.
Is there any reason they cannot use async/await for asynchronous startup, and use throw in place of manual termination? I think that's the "simple" way and should work for most people.
termination is for resource cleanup when shutting down, there needs to be an entry point to that. also all NIO based clients (eg db client based on NIO) need access the the EventLoop
for initialization to avoid thread hops
superseded by #273
motivation: make simple things simple
changes: