Git Product home page Git Product logo

Comments (5)

devoncarew avatar devoncarew commented on May 1, 2024

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.

sethladd avatar sethladd commented on May 1, 2024

Thanks for taking a look!

from grinder.dart.

NicholasTuck avatar NicholasTuck commented on May 1, 2024

@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.

devoncarew avatar devoncarew commented on May 1, 2024

@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.

devoncarew avatar devoncarew commented on May 1, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.