AWS Lambda's callbackWaitsForEmptyEventLoop in C# SDK
up vote
0
down vote
favorite
According to Mongo Atlas integration with AWS's best practices page, AWS Lambda's callbackWaitsForEmptyEventLoop
's value should be set to false
but I can't find this property in .NET SDK.
Is this specific to NodeJS or is it available in .NET too?
c# .net mongodb amazon-web-services aws-lambda
add a comment |
up vote
0
down vote
favorite
According to Mongo Atlas integration with AWS's best practices page, AWS Lambda's callbackWaitsForEmptyEventLoop
's value should be set to false
but I can't find this property in .NET SDK.
Is this specific to NodeJS or is it available in .NET too?
c# .net mongodb amazon-web-services aws-lambda
You mean here I presume, and you really should include any links you refer to within your question. If you read the page it's quite clearly NodeJS specific. If you read the linked article on that page it's not only clearly about NodeJS, but mentions various sections about where they apply to "general" best practices for any language and which are all about NodeJS and the implementation on AWS Lambda.
– Neil Lunn
Nov 22 at 5:06
The callbackWaitsForEmptyEventLoop property is specific to the NodeJS Context object.
– ChouW
Nov 22 at 5:32
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
According to Mongo Atlas integration with AWS's best practices page, AWS Lambda's callbackWaitsForEmptyEventLoop
's value should be set to false
but I can't find this property in .NET SDK.
Is this specific to NodeJS or is it available in .NET too?
c# .net mongodb amazon-web-services aws-lambda
According to Mongo Atlas integration with AWS's best practices page, AWS Lambda's callbackWaitsForEmptyEventLoop
's value should be set to false
but I can't find this property in .NET SDK.
Is this specific to NodeJS or is it available in .NET too?
c# .net mongodb amazon-web-services aws-lambda
c# .net mongodb amazon-web-services aws-lambda
asked Nov 22 at 3:46
nick-s
1,13932853
1,13932853
You mean here I presume, and you really should include any links you refer to within your question. If you read the page it's quite clearly NodeJS specific. If you read the linked article on that page it's not only clearly about NodeJS, but mentions various sections about where they apply to "general" best practices for any language and which are all about NodeJS and the implementation on AWS Lambda.
– Neil Lunn
Nov 22 at 5:06
The callbackWaitsForEmptyEventLoop property is specific to the NodeJS Context object.
– ChouW
Nov 22 at 5:32
add a comment |
You mean here I presume, and you really should include any links you refer to within your question. If you read the page it's quite clearly NodeJS specific. If you read the linked article on that page it's not only clearly about NodeJS, but mentions various sections about where they apply to "general" best practices for any language and which are all about NodeJS and the implementation on AWS Lambda.
– Neil Lunn
Nov 22 at 5:06
The callbackWaitsForEmptyEventLoop property is specific to the NodeJS Context object.
– ChouW
Nov 22 at 5:32
You mean here I presume, and you really should include any links you refer to within your question. If you read the page it's quite clearly NodeJS specific. If you read the linked article on that page it's not only clearly about NodeJS, but mentions various sections about where they apply to "general" best practices for any language and which are all about NodeJS and the implementation on AWS Lambda.
– Neil Lunn
Nov 22 at 5:06
You mean here I presume, and you really should include any links you refer to within your question. If you read the page it's quite clearly NodeJS specific. If you read the linked article on that page it's not only clearly about NodeJS, but mentions various sections about where they apply to "general" best practices for any language and which are all about NodeJS and the implementation on AWS Lambda.
– Neil Lunn
Nov 22 at 5:06
The callbackWaitsForEmptyEventLoop property is specific to the NodeJS Context object.
– ChouW
Nov 22 at 5:32
The callbackWaitsForEmptyEventLoop property is specific to the NodeJS Context object.
– ChouW
Nov 22 at 5:32
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
The context
given to each lambda function is specific to each language (You can read about the C# one here).
callbackWaitsForEmptyEventLoop
is unique to NodeJS, because of the various ways lambda can detects that a node handler has completed and is returning a response. In the case of Atlas' best practice, this is suggested because if you use the persistent scope outside the handler to pool a connection between invocations, lambda will halt waiting for the socket to close (empty the event loop).e
.NET has its own way of explicitly determining when to return.
Does that mean that there's no handle on the persistent scope that handles the mongo connection pool in .NET as there is in NodeJS? Is it on by default in .NET?
– nick-s
Nov 23 at 0:10
1
You should be able to do it, by taking the connection outside the handler scope (e.g. making it a global). I've found mixed reports of this working, however- depending on how well the library you're using supports the connection freezing the lambda does. Typically the pattern is to check if you have still have a live connection, but be prepared to set one up if the thawed connection cannot re-establish (e.g. it could have timed out on the other end)
– thomasmichaelwallace
Nov 23 at 9:01
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
The context
given to each lambda function is specific to each language (You can read about the C# one here).
callbackWaitsForEmptyEventLoop
is unique to NodeJS, because of the various ways lambda can detects that a node handler has completed and is returning a response. In the case of Atlas' best practice, this is suggested because if you use the persistent scope outside the handler to pool a connection between invocations, lambda will halt waiting for the socket to close (empty the event loop).e
.NET has its own way of explicitly determining when to return.
Does that mean that there's no handle on the persistent scope that handles the mongo connection pool in .NET as there is in NodeJS? Is it on by default in .NET?
– nick-s
Nov 23 at 0:10
1
You should be able to do it, by taking the connection outside the handler scope (e.g. making it a global). I've found mixed reports of this working, however- depending on how well the library you're using supports the connection freezing the lambda does. Typically the pattern is to check if you have still have a live connection, but be prepared to set one up if the thawed connection cannot re-establish (e.g. it could have timed out on the other end)
– thomasmichaelwallace
Nov 23 at 9:01
add a comment |
up vote
0
down vote
The context
given to each lambda function is specific to each language (You can read about the C# one here).
callbackWaitsForEmptyEventLoop
is unique to NodeJS, because of the various ways lambda can detects that a node handler has completed and is returning a response. In the case of Atlas' best practice, this is suggested because if you use the persistent scope outside the handler to pool a connection between invocations, lambda will halt waiting for the socket to close (empty the event loop).e
.NET has its own way of explicitly determining when to return.
Does that mean that there's no handle on the persistent scope that handles the mongo connection pool in .NET as there is in NodeJS? Is it on by default in .NET?
– nick-s
Nov 23 at 0:10
1
You should be able to do it, by taking the connection outside the handler scope (e.g. making it a global). I've found mixed reports of this working, however- depending on how well the library you're using supports the connection freezing the lambda does. Typically the pattern is to check if you have still have a live connection, but be prepared to set one up if the thawed connection cannot re-establish (e.g. it could have timed out on the other end)
– thomasmichaelwallace
Nov 23 at 9:01
add a comment |
up vote
0
down vote
up vote
0
down vote
The context
given to each lambda function is specific to each language (You can read about the C# one here).
callbackWaitsForEmptyEventLoop
is unique to NodeJS, because of the various ways lambda can detects that a node handler has completed and is returning a response. In the case of Atlas' best practice, this is suggested because if you use the persistent scope outside the handler to pool a connection between invocations, lambda will halt waiting for the socket to close (empty the event loop).e
.NET has its own way of explicitly determining when to return.
The context
given to each lambda function is specific to each language (You can read about the C# one here).
callbackWaitsForEmptyEventLoop
is unique to NodeJS, because of the various ways lambda can detects that a node handler has completed and is returning a response. In the case of Atlas' best practice, this is suggested because if you use the persistent scope outside the handler to pool a connection between invocations, lambda will halt waiting for the socket to close (empty the event loop).e
.NET has its own way of explicitly determining when to return.
answered Nov 22 at 9:51
thomasmichaelwallace
2,3401817
2,3401817
Does that mean that there's no handle on the persistent scope that handles the mongo connection pool in .NET as there is in NodeJS? Is it on by default in .NET?
– nick-s
Nov 23 at 0:10
1
You should be able to do it, by taking the connection outside the handler scope (e.g. making it a global). I've found mixed reports of this working, however- depending on how well the library you're using supports the connection freezing the lambda does. Typically the pattern is to check if you have still have a live connection, but be prepared to set one up if the thawed connection cannot re-establish (e.g. it could have timed out on the other end)
– thomasmichaelwallace
Nov 23 at 9:01
add a comment |
Does that mean that there's no handle on the persistent scope that handles the mongo connection pool in .NET as there is in NodeJS? Is it on by default in .NET?
– nick-s
Nov 23 at 0:10
1
You should be able to do it, by taking the connection outside the handler scope (e.g. making it a global). I've found mixed reports of this working, however- depending on how well the library you're using supports the connection freezing the lambda does. Typically the pattern is to check if you have still have a live connection, but be prepared to set one up if the thawed connection cannot re-establish (e.g. it could have timed out on the other end)
– thomasmichaelwallace
Nov 23 at 9:01
Does that mean that there's no handle on the persistent scope that handles the mongo connection pool in .NET as there is in NodeJS? Is it on by default in .NET?
– nick-s
Nov 23 at 0:10
Does that mean that there's no handle on the persistent scope that handles the mongo connection pool in .NET as there is in NodeJS? Is it on by default in .NET?
– nick-s
Nov 23 at 0:10
1
1
You should be able to do it, by taking the connection outside the handler scope (e.g. making it a global). I've found mixed reports of this working, however- depending on how well the library you're using supports the connection freezing the lambda does. Typically the pattern is to check if you have still have a live connection, but be prepared to set one up if the thawed connection cannot re-establish (e.g. it could have timed out on the other end)
– thomasmichaelwallace
Nov 23 at 9:01
You should be able to do it, by taking the connection outside the handler scope (e.g. making it a global). I've found mixed reports of this working, however- depending on how well the library you're using supports the connection freezing the lambda does. Typically the pattern is to check if you have still have a live connection, but be prepared to set one up if the thawed connection cannot re-establish (e.g. it could have timed out on the other end)
– thomasmichaelwallace
Nov 23 at 9:01
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53423586%2faws-lambdas-callbackwaitsforemptyeventloop-in-c-sharp-sdk%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You mean here I presume, and you really should include any links you refer to within your question. If you read the page it's quite clearly NodeJS specific. If you read the linked article on that page it's not only clearly about NodeJS, but mentions various sections about where they apply to "general" best practices for any language and which are all about NodeJS and the implementation on AWS Lambda.
– Neil Lunn
Nov 22 at 5:06
The callbackWaitsForEmptyEventLoop property is specific to the NodeJS Context object.
– ChouW
Nov 22 at 5:32