mssh | the script tool to create ssh jumper server | SSH library
kandi X-RAY | mssh Summary
kandi X-RAY | mssh Summary
the script tool to create ssh jumper server.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of mssh
mssh Key Features
mssh Examples and Code Snippets
Community Discussions
Trending Discussions on mssh
QUESTION
I read this article and was trying to do the same https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/async/
I am looping through a set of entities in ODATA and trying to process them all in the same time (function Load() ). My console app look like this
...ANSWER
Answered 2020-Apr-16 at 13:51It seems like you are confusing asynchronous with parallel.
- Asynchronous means "while this other thing is happening, stop running my code and let the current thread go work on something else"
- Parallel means "run these two (or more) pieces of code at the same time" (this requires more than one thread)
Asynchronous methods are normal methods: when you call them, they run on the same thread just like any other method. The magic happens at the first await
that acts on an incomplete Task
. At that point, await
will return it's own incomplete Task
and sign up the rest of the method to complete after that Task
completes.
In your case, when you call entity.Load()
, then entity.Load()
runs just like it would if it was not marked async
up until the first await
. The only await
is at await Task.WhenAny(listTaskWrite)
, but you're not showing how listTaskWrite
is populated, so maybe that code is never being hit. But regardless, everything before that await
will run normally, as if it wasn't an async
method.
You have a couple options. If you're making a network request in Extract()
, you can change that code to make it asynchronous (all the methods in HttpClient
are asynchronous), then get rid of the Parallel.ForEach
. In that way, it will start the HTTP request, and it will start working on the next request while it's waiting for a reply. All of this could all end up using one single thread, but you're using it to the full - it will never be just sitting there doing nothing while waiting for a reply. That's the best use of resources. That would look something like this (assuming you modify Extract()
to be asynchronous and you want to use listTaskWrite
for this purpose):
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install mssh
execute below command(optional, it can be used by absolute path)
add mssh group and add group to sudoer(required only when deploy jumper server)
add manager group and add group to sudoer(required only when you want grant user manager access to other but root)
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page