-
Notifications
You must be signed in to change notification settings - Fork 116
Reuse DispatchQueue for multiple Invocations #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -25,17 +25,27 @@ import NIO | |||
/// The `EventLoopLambdaHandler` will execute the Lambda on the same `EventLoop` as the core runtime engine, making the processing faster but requires | |||
/// more care from the implementation to never block the `EventLoop`. | |||
public protocol LambdaHandler: EventLoopLambdaHandler { | |||
@inlinable var dispatchQueue: DispatchQueue { get } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@weissi does @inlinable
make any sense here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, it's just a function call, no generics or optimisation potential
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
d55af4a
to
a7c5813
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome, thank you!
@@ -25,17 +25,27 @@ import NIO | |||
/// The `EventLoopLambdaHandler` will execute the Lambda on the same `EventLoop` as the core runtime engine, making the processing faster but requires | |||
/// more care from the implementation to never block the `EventLoop`. | |||
public protocol LambdaHandler: EventLoopLambdaHandler { | |||
var dispatchQueue: DispatchQueue { get } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we call this offloadQueue
or something the tells what this is about?
func handle(context: Lambda.Context, payload: In, callback: @escaping (Result<Out, Error>) -> Void) | ||
} | ||
|
||
private extension Lambda { | ||
static let handlerQueue = DispatchQueue(label: "LambdaHandler.offload") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defaultOffloadQueue?
a7c5813
to
1ac951c
Compare
should fix #39