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?










share|improve this question






















  • 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















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?










share|improve this question






















  • 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













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?










share|improve this question













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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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


















  • 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












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.






share|improve this answer





















  • 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











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',
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
});


}
});














draft saved

draft discarded


















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








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.






share|improve this answer





















  • 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















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.






share|improve this answer





















  • 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













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.






share|improve this answer












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.







share|improve this answer












share|improve this answer



share|improve this answer










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


















  • 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


















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

What visual should I use to simply compare current year value vs last year in Power BI desktop

Alexandru Averescu

Trompette piccolo