Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Easy C# API for Distributed Background Tasks/Jobs for .NET Core.

License

NotificationsYou must be signed in to change notification settings

brthor/Gofer.NET

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build StatusNuget Version NumberJoin the chat at https://gitter.im/Gofer-NET/Lobby

Documentation

Read the Docs

What is this?

This is a distributed job runner for .NET Standard 2.0 Applications.

Inspired by Celery for Python, it allows you to quickly queue code execution on a worker pool.

  • Use natural expression syntax to queue jobs for execution.

  • Queued jobs are persisted, and automatically run by the first available worker.

  • Scale your worker pool by simply adding new nodes.

  • Backed by Redis, all tasks are persistent.

Getting Started

Install the dotnet cli.

We recommend using thedotnet cli to get started, but it's not a necessity.

The dotnet cli is part of the.NET Core SDK.

Start a Redis instance.

We recommend usingdocker to start a local Redis instance for testing. Setting up a production-level Redis instance is out of the scope of this documentation.

$ docker run -d -p 127.0.0.1:6379:6379 redis:4-alpine

Create a project.

Open up a terminal and create a new console project to get started.

$ mkdir myProject&&cd myProject$ dotnet new console

Add the Gofer.NET NuGet package.

$ dotnet add package Gofer.NET --version 1.0.0-*

Queue up some jobs.

This exampleProgram.cs shows how to queue jobs for the worker pool to process, then start a worker to go and run them.

Some important notes:

  • Workers would usually be on a separate machine from the code queueing the jobs, this is purely to give an example.

  • More workers can be added at any time, and will start picking up jobs off the queue immediately.

publicclassProgram{publicstaticasyncTaskMain(string[]args){varredisConnectionString="127.0.0.1:6379";// Create a Task Client connected to RedisvartaskClient=newTaskClient(TaskQueue.Redis(redisConnectionString));// Queue up a Sample JobawaittaskClient.TaskQueue.Enqueue(()=>SampleJobFunction("Hello World!"));// Start the task listener, effectively turning this process into a worker.// NOTE: This will loop endlessly waiting for new tasks.awaittaskClient.Listen();}privatestaticvoidSampleJobFunction(objectvalue){Console.WriteLine(value.ToString());}}

Read the Docs for more details.

About

Easy C# API for Distributed Background Tasks/Jobs for .NET Core.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp