Skip to content
This repository has been archived by the owner on Oct 13, 2018. It is now read-only.

Latest commit

 

History

History
49 lines (40 loc) · 954 Bytes

README.md

File metadata and controls

49 lines (40 loc) · 954 Bytes

THIS PROJECT IS NOT SUPPORTED. Feel free to fork or whatever.

Razensoft.Faktory

.NET implementation of Faktory worker and client

Installation

Nuget package TBD. For now you need to compile it yourself.

Usage

Use FaktoryClient for job creation

using Razensoft.Faktory;
...
var client = new FaktoryClient
{
    Password = "pass"
};
await client.ConnectAsync("127.0.0.1");
await client.PublishAsync(new Job
{
    Type = "TestJob",
    Id = Guid.NewGuid().ToString(),
    Args = new object[] { 1, 2, "Hello"}
});

And FaktoryWorker for job consumption

using Razensoft.Faktory;
...
var worker = new FaktoryWorker
{
    Password = "pass",
    SubscribedQueues = { "default" }
};
worker.Register("TestJob", TestJob);
await worker.ConnectAsync("127.0.0.1");
await worker.RunAsync();
...
private static void TestJob(object[] args)
{
    throw new NotImplementedException();
}