GithubHelp home page GithubHelp logo

hhalim / shift Goto Github PK

View Code? Open in Web Editor NEW
9.0 4.0 3.0 1.52 MB

Shift jobs into another process outside of the client app internal process. Monitor, stop, reset and run jobs out of band.

License: MIT License

C# 100.00%
c-sharp background-jobs server-side-technologies azure windows-service redis reliable durable azure-webjob mongodb

shift's Introduction

Shift

Move background or long running jobs into reliable and durable processes out of your main application thread. Shift enables your application to easily run long running jobs in separate threads or processes.

Features:

  • Open source and free - including commercial use.
  • Reliable and durable background and long running jobs.
  • Out of band processing of long running jobs.
  • Ability to pause, stop, reset, and restart long running jobs.
  • Auto removal of older jobs.
  • Scale out with multiple Shift servers to run large number of jobs.
  • Multiple options for persistent storage: Redis, MongoDB, Microsoft SQL server, or Azure DocumentDB.
  • Optional detailed, customizable progress tracking for each running jobs.
  • Optional encryption for serialized data.
  • Run Shift Server library in your own .NET apps, Azure WebJobs, or Windows services. Use nuget.org for easy integration.

The client library allows client apps to add jobs and send commands to Shift server to pause, stop, delete, reset, and run jobs.

A simple example of adding a job:

var job = new TestJob();
var jobID = jobClient.Add(() => job.Start("Hello world!"));

Adding a job asynchronously with even simpler job:

var jobID = await jobClient.AddAsync(() => Console.WriteLine("Hello world!"));

Add a long running job with a pause, cancellation token, and progress update:

var job = new TestJob();
var progress = new SynchronousProgress<ProgressInfo>();
var cancelToken = (new CancellationTokenSource()).Token; 
var pauseToken = (new PauseTokenSource()).Token;
var jobID = jobClient.Add("Shift.Demo.Client", () => job.Start("Hello world!", progress, cancelToken, pauseToken));

The server component periodically checks for available jobs using first-in, first-out (FIFO) queue method. The server is a simple .NET library and able to run inside a host .NET app, Azure WebJob, or Windows service.

Sample host Shift server projects are provided as a starting point:

  • Shift.WinService is the standalone Windows service server component, multiple services can be installed in the same server.
  • Shift.Topshelf is the open source Topshelf package version for Windows service. This project allows simpler debugging and deployment to Windows.
  • Shift.WebJob is the Azure cloud WebJob app, multiple web jobs can also be deployed to multiple Azure App Services.

Demos

Check out the demo apps on how to integrate Shift into .NET application. The ASP.NET MVC demo shows Shift client and server running in the same ASP.NET process. The simpler console Shift client and server demos are two separate projects that demonstrate a client and a server working in two different processes.

Quick Start and More

Shift package is on nuget.org, but first check out the Shift wiki for the Quick Start. Other important topics in the wiki: Assembly Loading, Scheduling, Batch, or Continuation, Message Queuing, and more.

Credits

Shift uses the following open source projects:

shift's People

Contributors

hhalim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

shift's Issues

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.