Comments (5)
I'll need to think about how to handle this. There are two ways to run processes - sync and async. The sync API returns all the stdout and stderr that happened during process execution, but you don't get access the the I/O as it occurs. So, no streaming.
The async way does get you access to I/O streams. But the async nature of the call would bubble up through all the callers. We'd loose the current simplification that we're doing sync programming and not async.
If I can't figure out way to make this work w/o additional API, I might add explicit named calls (performFooSync
and performFooAsync
).
from grinder.dart.
Thanks for taking a look!
from grinder.dart.
@devoncarew from my experimentation it appears that Grinder does support returning futures from within tasks, so if pub tools returned a future for these things and the task function also returned that or a final future it seems like everything should function. Is this incorrect somewhere?
I only ask as we are still learning Grinder and we want to ensure that returning futures does work as expected/it appears to be working. There may be more complications I am overlooking though. Thanks for the info!
from grinder.dart.
@NicholasTuck, you're spot on w/ how returning Futures works in grinder. The current API looks like:
void PubTools.build(...);
and the new API might look something like:
Future PubTools.buildAsync(...);
and the implementation of that task would make sure that it streamed the stdout/err as it occurred. I've preferred keeping the APIs for grinder synchronous in order to reduce the burden on clients of the API. But it makes sense to add a parallel set of APIs available for the streaming functionality, and clients can choose to use other APIs those if they prefer.
from grinder.dart.
I added some new async APIs, available in 0.5.7. You can see them used here: https://github.com/google/grinder.dart/blob/master/example/ex2.dart.
from grinder.dart.
Related Issues (20)
- Allow dependency tasks to run in parallel
- File operations aren't Windows-friendly
- [Feature request] Analyzer: respect `exclude` from `analysis_options.yaml` file HOT 1
- Is it possible to run terminal commands? HOT 1
- No puspec.yaml in _fe_analyzer_shared-3.0.0 ? HOT 1
- unused dart:async in grinder.dart HOT 1
- Using extensions HOT 1
- readLineSync not working in a grinder task
- publish null-safe package version HOT 10
- not displaying out of build_runner watch command HOT 2
- Grinder can't find Dart executable on Dart 2.13.1 / Flutter 2.2.1 HOT 1
- using via flutter error `grind: 7: pub: not found` HOT 1
- .
- run() shows garbled text in Windows 10
- ProcessException: No such file or directory HOT 1
- Pub broken on Dart 2.17 HOT 2
- How to pass arguments to dependent tasks?
- `grinder` as globally activated doesn't support Dart 3.0.0-417.3.beta HOT 14
- Cannot move/select any available option using arrow keys in command prompt
- Provide a way to expand existing tasks
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 grinder.dart.