Table of Contents

Class NativeJobOptions

Namespace
Quartz.Jobs
Assembly
Quartz.Jobs.dll

The command NativeJob runs, and how it runs it.

public sealed record NativeJobOptions : IEquatable<NativeJobOptions>
Inheritance
NativeJobOptions
Implements
Inherited Members

Remarks

The job is configured through its JobDataMap, and those keys are the persisted contract — this type is the named way to write and read them. UsingNativeJobOptions<TConfigurator>(TConfigurator, NativeJobOptions) writes them, FromJobData(JobDataMap) reads them back, and job data written by hand or by an earlier version reads the same either way.

Properties

Command

The executable to run.

public required string Command { get; init; }

Property Value

string

ConsumeStreams

Whether the spawned process's stdout and stderr are read and logged. A process that writes more output than its pipe holds blocks until someone reads it, so leave this on for anything chatty. Defaults to false.

public bool ConsumeStreams { get; init; }

Property Value

bool

Parameters

The parameters to pass to the command, or null for none.

public string? Parameters { get; init; }

Property Value

string

WaitForProcess

Whether the job waits for the process to exit before it completes, which is also what makes the exit code available as Result. Defaults to true.

public bool WaitForProcess { get; init; }

Property Value

bool

WorkingDirectory

The working directory to start the process in, or null to inherit the scheduler's.

public string? WorkingDirectory { get; init; }

Property Value

string

Methods

FromJobData(JobDataMap)

Reads the options out of a job's data, taking the default for every key it does not carry.

public static NativeJobOptions FromJobData(JobDataMap data)

Parameters

data JobDataMap

The job data to read, normally MergedJobDataMap.

Returns

NativeJobOptions

Exceptions

JobExecutionException

PropertyCommand is absent; there is nothing to run.

ToJobData()

Writes the options as the job data keys NativeJob reads.

public JobDataMap ToJobData()

Returns

JobDataMap