CliWrap | Library for running command-line processes | Command Line Interface library
kandi X-RAY | CliWrap Summary
kandi X-RAY | CliWrap Summary
Library for running command-line processes
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 CliWrap
CliWrap Key Features
CliWrap Examples and Code Snippets
Community Discussions
Trending Discussions on CliWrap
QUESTION
I have a .Net 5 Core application which I am converting to a docker container(linux base). This application however calls python script to do some computation. The python script needs stix2 library, so I do an initial setup first to create a virtualenv and install stix2 library like this:
...ANSWER
Answered 2021-Aug-01 at 05:28Though not a direct solution to your question, I would suggest that you reconsider the current design. A better approach may be deploy your python as a separate container with Flask or FastAPI to run as a API and then consume that API from your .Net Core container like an regular REST API. You wont need any custom application launcher or store intermediate result files.
For deployment, you can either chose to have it as a multi-container pod or deploy them as separate pods. So lets say, you add more computational functions into your Python API, you can scale it independently, if you are deploying them as separate pods.
QUESTION
I'm converting previous synchronous Quartz.NET 2.0 jobs to the new async Quartz.NET 3.0 framework and I was curious what the best practice was for dealing with the results of calling another async method that you need the results from?
In my scenario I'm using a package called CliWrap that is for interacting with command line executables. In my scenario I use their buffered option which captures the stdout and stderr streams into a buffer that you can then inspect.
My question then, is it better to have the Quartz job wait on the result from the CliWrap call (Option 1 below) or is it better to have the job be async as well and assign a JobListener to grab the buffered result when the job completes (Option 2 below)? Thanks
Option 1
...ANSWER
Answered 2020-May-01 at 11:21You should almost never use GetAwaiter().GetResult()
in any context. You are blocking the thread with GetAwaiter().GetResult()
and it will waste the whole purpose of async
and await
.
You should go with Option 2.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install CliWrap
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