Comments (4)
I have the same problem. On Windows the build fails with:
asyncpipe.nim(260, 16) Error: undeclared identifier: 'PCustomOverlapped'
The build is easy to fix by importing asyncpty
in asyncpipe.nim
, but then the following simple example crashes.
import strformat, std/enumerate, os, asyncdispatch, asynctools/asyncproc
type
ProcessOutput = tuple[exitCode: int, output: string]
var urlsToDownload: seq[string] = @[
"www.w3.org/TR/html401/html40.txt",
"www.w3.org/TR/2002/REC-xhtml1-20020801/xhtml1.pdf",
"www.w3.org/TR/REC-html32.html",
"www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/DOM2-Core.txt"]
proc downloadUrl(url: string): Future[ProcessOutput] {.async.} =
return await asyncproc.execProcess(&"curl {url}")
var urlsContents: seq[Future[ProcessOutput]]
for url in urlsToDownload:
echo &"Downloading {url} ..."
urlsContents.add downloadUrl(url)
let results = waitFor all(urlsContents)
for i, result in enumerate(results):
if result.exitCode != QuitSuccess:
echo &"Error {result.exitCode}: {result.output}"
continue
let fileName = urlsToDownload[i].splitPath.tail
writeFile(fileName, result.output)
I want to use the library for asynchronous processes in Nimble and this bug is blocking me.
from asynctools.
I found that the error happens only when there are more than one asynchronous processes. Then the program enters in the following branch.
from asynctools.
you still get error after this ?84ced6d
from asynctools.
you still get error after this ?84ced6d
Yes, the example above still raises an exception on Windows.
from asynctools.
Related Issues (20)
- asyncipc doesn't work on macos HOT 2
- Ubuntu 18.04 compile error for asyncpipe HOT 1
- The AsyncIPC example does not work on windows HOT 2
- execProcess unhandled exception: index out of bounds
- Fails to compile on 0.19.0 HOT 1
- asyncproc does not expose close procedure
- AsyncProc crashes when multiple processes are started
- missing .gcsafe in asyncsync HOT 2
- Help with asyncproc simultaneous stdout & stderr? HOT 1
- Crash when starting more than one asynchronous processes on Windows.
- Issues with using asyncPipe and faststream
- AsyncIpc seems to be broken on devel for Windows HOT 1
- Error: expression cannot be cast to 'pointer' HOT 2
- async stdin and stdout on Windows
- how to feed commands to external process and catch output HOT 1
- Nim v2: asyncpipe.createPipe in windows broken by upstream
- Async task not waiting for event once fired
- Multiple A records for one name HOT 9
- Terminating async process on macOS doesn't work HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asynctools.