Skip to content

AnyQ.Jobs

Stephen Collins edited this page Feb 8, 2018 · 2 revisions

HandlerConfiguration

Defines options for creating the queue assigned to a AnyQ.Jobs.JobHandler

public class AnyQ.Jobs.HandlerConfiguration

Properties

Type Name Summary
String QueueId Unique Id for the queue
String QueueName Human-readable name for the queue
Nullable<TimeSpan> ThrottleInterval Rate at which the queue receives jobs

IJobHandlerLocator

Provides methods for locating AnyQ.Jobs.JobHandlers within an assembly

public interface AnyQ.Jobs.IJobHandlerLocator

Methods

Type Name Summary
IEnumerable<JobHandler> GetHandlers() Returns all handlers available to this instance
Boolean TryGetHandlerByQueueId(String queueId, JobHandler& handler) Retrieve a AnyQ.Jobs.JobHandler instance by the Id of the queue it listens for

JobHandler

Provides methods and properties for processing queue messages via AnyQ.Jobs.ProcessingRequest objects

public abstract class AnyQ.Jobs.JobHandler
    : IEquatable<JobHandler>

Properties

Type Name Summary
HandlerConfiguration Configuration The configuration used to create the corresponding queue for this handler

Events

Type Name Summary
EventHandler<ProcessingCompletedEventArgs> ProcessingCompleted Fired when a job is successfully completed
EventHandler<ProcessingFailedEventArgs> ProcessingFailed Fired when a job's processing fails

Methods

Type Name Summary
Boolean CanProcess(ProcessingRequest request) Returns whether or not this handler can process the job described by the AnyQ.Jobs.ProcessingRequest
Boolean Equals(JobHandler other) Returns a value indicating whether this instance is equal to a specified AnyQ.Jobs.JobHandler
Boolean Equals(Object obj) Returns a value indicating whether this instance is equal to a specified AnyQ.Jobs.JobHandler
Int32 GetHashCode() Returns the hash code for this queue's identifiers
IEnumerable<RedirectStrategy> GetRedirectStrategies() Provides a list of AnyQ.Jobs.RedirectStrategy objects for resilient processing
void OnProcessingCompleted(ProcessingRequest request, String result = null) Invoked when the processing of a AnyQ.Jobs.ProcessingRequest completes successfully
void OnProcessingFailed(ProcessingRequest request, Exception exception) Invoked when the processing of a AnyQ.Jobs.ProcessingRequest fails
Task ProcessAsync(ProcessingRequest request, CancellationToken cancellationToken) Processes the job
String ToString() Returns a string that describes the AnyQ.Jobs.JobHandler

JobRequest

Represents a job to be performed

public class AnyQ.Jobs.JobRequest

Properties

Type Name Summary
String Payload Serialized data for use by the job handler
String Type Name for the type of work to perform

Methods

Type Name Summary
String ToString() Returns a simple description of the job

JobStatus

Represents information about the status of a AnyQ.Jobs.ProcessingRequest

public class AnyQ.Jobs.JobStatus

Properties

Type Name Summary
DateTime CreatedOn Date this object was created
String Details String providing more details on the status (e.g., System.Exception information)
String JobId Unique identifier for the message containing this job request
String JobName Human-readable name for the message containing this job request
String QueueId Unique identifier of the originating queue
String QueueName Descriptive name of the originating queue
String Status String describing the status of the job

Static Fields

Type Name Summary
String Canceled Indicates that the AnyQ.Jobs.ProcessingRequest was interrupted by a cancellation
String Complete Indicates that the AnyQ.Jobs.ProcessingRequest was processed successfully
String Failed Indicates that processing of the AnyQ.Jobs.ProcessingRequest failed
String Processing Indicates that an AnyQ.Jobs.JobHandler is currently processing the AnyQ.Jobs.ProcessingRequest
String Received Indicates that a queue has received the AnyQ.Jobs.ProcessingRequest
String Redirected Indicates that the AnyQ.Jobs.ProcessingRequest processing time has been redirected to another queue
String Skipped Indicates that the AnyQ.Jobs.ProcessingRequest was unable to be handled by any currently registered AnyQ.Jobs.JobHandler
String Stalled Indicates that the AnyQ.Jobs.ProcessingRequest has stalled during processing
String TimedOut Indicates that the AnyQ.Jobs.ProcessingRequest processing time has exceeded the timeout limit

ProcessingCompletedEventArgs

Represents the event data for when an AnyQ.Jobs.JobHandler completes processing a AnyQ.Jobs.ProcessingCompletedEventArgs.ProcessingRequest

public class AnyQ.Jobs.ProcessingCompletedEventArgs
    : EventArgs

Properties

Type Name Summary
ProcessingRequest ProcessingRequest AnyQ.Jobs.ProcessingCompletedEventArgs.ProcessingRequest that was successfully processed
String ResultBody Serialized body of result of processing

ProcessingFailedEventArgs

Represents the event data for when processing of a AnyQ.Jobs.ProcessingFailedEventArgs.ProcessingRequest fails

public class AnyQ.Jobs.ProcessingFailedEventArgs
    : EventArgs

Properties

Type Name Summary
Exception Exception Set of exceptions that occurred.
ProcessingRequest ProcessingRequest AnyQ.Jobs.ProcessingFailedEventArgs.ProcessingRequest that was processed

ProcessingRequest

Represents a request for processing a job

public class AnyQ.Jobs.ProcessingRequest

Properties

Type Name Summary
String JobId Unique identifier for the job
JobRequest JobRequest Body of the job request
String Name Human-readable name for the job
String QueueId Unique identifier for the queue the request originated from
String QueueName Human-readable name for the queue the request originated from

Methods

Type Name Summary
String ToString() Returns a useful string representation of the request

RedirectStrategy

Represents a strategy for redirecting a AnyQ.Jobs.ProcessingRequest in the pipeline

public class AnyQ.Jobs.RedirectStrategy

Properties

Type Name Summary
Func<JobStatus, Exception, Boolean> Decider Function to determine whether or not to redirect to a new queue
Func<JobStatus, String> Redirect Function to determine which queue to redirect to

Static Methods

Type Name Summary
RedirectStrategy Create(Func<JobStatus, Exception, Boolean> decider, Func<JobStatus, String> redirect) Create a new AnyQ.Jobs.RedirectStrategy with the specified behaviors

Clone this wiki locally