Coder Social home page Coder Social logo

Comments (3)

TomKaltz avatar TomKaltz commented on June 8, 2024

After some digging, found the info() function of the vm context. Very nice! This needs to be added to documentation.

from node-workflow.

kusor avatar kusor commented on June 8, 2024

@TomKaltz note that the info property of jobs is intended to be used by external APIs w/o access to the job itself.

Within a task, you have access to the whole job object, so you can use whatever the identifiers you need to attach any additional properties to the job itself.

However, when a task of a workflow performs a call to a remote API, which in turn may need to perform an operation which may consist of either several steps or a long time period, it's desirable to have a way for that remote API to provided some feedback of the progress of the operation taking place (name of remote step happening, percentage of task completed ...). That way, the user trying to get up2date information about the workflow execution don't need to wait until the task is completely finished to get access to such info.

As you can see, it's intended to be used through HTTP requests to the end-point /jobs/:job_uuid/info, and it's documented as part of the HTTP API and intentionally not documented as part of internal workflow docs.

Has sense?

from node-workflow.

TomKaltz avatar TomKaltz commented on June 8, 2024

But when my task controls the external process (a spawned executable) is it acceptable to use info() to store progress data for the front-end user to query while the job is in-progress?

My use case is video transcoding where my task spawns an external ffmpeg process to convert a video file.

This does work for me but I want to know if I'm missing some unintended consequence of using info(progressInfo) in this way

from node-workflow.

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.