AWS Lambda's callbackWaitsForEmptyEventLoop in C# SDK
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 |
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 '18 at 5:06
The callbackWaitsForEmptyEventLoop property is specific to the NodeJS Context object.
– ChouW
Nov 22 '18 at 5:32
add a comment |
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 '18 at 3:46
nick-snick-s
1,17432853
1,17432853
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 '18 at 5:06
The callbackWaitsForEmptyEventLoop property is specific to the NodeJS Context object.
– ChouW
Nov 22 '18 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 '18 at 5:06
The callbackWaitsForEmptyEventLoop property is specific to the NodeJS Context object.
– ChouW
Nov 22 '18 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 '18 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 '18 at 5:06
The callbackWaitsForEmptyEventLoop property is specific to the NodeJS Context object.
– ChouW
Nov 22 '18 at 5:32
The callbackWaitsForEmptyEventLoop property is specific to the NodeJS Context object.
– ChouW
Nov 22 '18 at 5:32
add a comment |
1 Answer
1
active
oldest
votes
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 '18 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 '18 at 9:01
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
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 '18 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 '18 at 9:01
add a comment |
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 '18 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 '18 at 9:01
add a comment |
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 '18 at 9:51
thomasmichaelwallacethomasmichaelwallace
2,6701917
2,6701917
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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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.
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 '18 at 5:06
The callbackWaitsForEmptyEventLoop property is specific to the NodeJS Context object.
– ChouW
Nov 22 '18 at 5:32