Skip to content

G3N7/MonJobs

Repository files navigation

MonJobs

A MongoDB based jobs database

Build Status

Services

Services are provided as Code APIs, REST APIs (Coming Soon), and WebSocket APIs (Coming Soon).

Create

Jobs are created with a queue id, allowing for segmentation and a set of attributes. IJobCreationService and MongoJobCreationService allows you to create a new Job by providing a QueueId and the JobAttributes, then returns the new Job.

PeekNext

New Jobs can be viewed without effecting the queue by peeking at the next set of jobs that matching a given attribute query. If one you chose to start a job you must first attempt an acknowledgment in order to ensure that it has not already been picked up. IJobPeekNextService and MongoJobPeekNextService allows you to peek at the queue using criteria provided in PeekNextOptions once you have peeked you can chose to apply a JobAcknowledgment a Job and then do the work.

PeekNextOptions

An object that holds the query parameters.

TakeNext

If you want to take the next job matching a given attribute query, this action will acknowledge the next available job and return its data. IJobTakeNextService and MongoJobTakeNextService allows you to take the next item in the queue given the criteria provided in the TakeNextOptions.

TakeNextOptions

An object that holds the options for the take feature.

Query

Allows you to query the jobs of a queue by the criteria of a job query. IJobQueryService and MongoJobQueryService make up the code API for seeing what jobs exist. This query is made using the JobQuery

JobQuery

An object that holds the query parameters.

  • QueueId: QueueId (Optional)
  • HasAttributes: JobAttributes (Optional)
  • Limit: int? (Optional)
  • HasBeenAcknowledged: bool? (Optional)
  • HasResult: bool? (Optional)

Acknowledge

If you have seen a job that you want to start working, you can post an acknowledgment which will return true if still available, or false if the job is already acknowledged. IJobAcknowledgmentService and MongoJobAcknowledgmentService allows you to apply a JobAcknowledgment to a Job and returns an AcknowledgmentResult.

AcknowledgmentResult

The result of trying to acknowledge a job.

  • Success: bool

Report

You can update the job with reports about the progress. IJobReportService and MongoJobReportService allow you to add as many JobReport to a Job as makes sense for your use-case.

Complete

One you have completed a job you can call this to report a final result. IJobCompletionService and MongoJobCompletionService allows you to add JobResult to a Job.

Types

Types are provided for static typing in C#, and serialize to BSON and JSON.

Job

The record for the job as a whole, it consists of:

JobId

The unique id for a given job.

JobAttributes

A dictionary of attributes for this job.

JobAcknowledgment

A record of the acknowledgment.

JobReport

A message about the progress of a job.

JobResult

A record of the final result.

QueueId

An identity that provides the ability to segment the queue, this can be leveraged as an Authorization point.

Roadmap

Obviously this is just high level information about where the project is heading.

Milestone Code (Achieved 6/8)

Get all services exposed via code API's functional with use-case based integration tests.

Milestone REST

Get all of the services exposed via HTTP resource/verb strategy using a master API key.

Milestone Docker

Get the rest API hosted in docker.

Milestone Authorization Segmentation

Getting queues to only be available to certain entity/pass combos.

About

A Mongo based jobs database

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published