Jason Jean f326bfe52e feat(core): introduce continuous tasks (#29750)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

An RFC about this feature is happening here: #29025. This has the most
information about this feature.

<!-- This is the behavior we have today -->

Nx currently does not explicitly handle tasks which run continuously
until they are terminated.

<!-- This is the behavior we should expect with the changes in this PR
-->

This PR adds the initial support for continuous tasks which run
continuously until they are terminated. This adds the ability to depend
on continuous tasks. There is some more work to be done but this will be
enough as an MVP.

<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-15 09:23:45 -04:00

3.1 KiB

Interface: Task

A representation of the invocation of an Executor

Table of contents

Properties

Properties

cache

Optional cache: boolean

Determines if a given task should be cacheable.


continuous

Optional continuous: boolean

This denotes if the task runs continuously


endTime

Optional endTime: number

Unix timestamp of when a Batch Task ends


hash

Optional hash: string

Hash of the task which is used for caching.


hashDetails

Optional hashDetails: Object

Details about the composition of the hash

Type declaration

Name Type Description
command string Command of the task
implicitDeps? { [fileName: string]: string; } Hashes of implicit dependencies which are included in the hash
nodes { [name: string]: string; } Hashes of inputs used in the hash
runtime? { [input: string]: string; } Hash of the runtime environment which the task was executed

id

id: string

Unique ID


outputs

outputs: string[]

The outputs the task may produce


overrides

overrides: any

Overrides for the configured options of the target


parallelism

parallelism: boolean

Determines if a given task should be parallelizable.


projectRoot

Optional projectRoot: string

Root of the project the task belongs to


startTime

Optional startTime: number

Unix timestamp of when a Batch Task starts


target

target: Object

Details about which project, target, and configuration to run.

Type declaration

Name Type Description
configuration? string The configuration of the target which the task invokes
project string The project for which the task belongs to
target string The target name which the task should invoke