Disque.Net
.Net library for the Disque distributed, in-memory message broker (i.e Redis as a job queue)
Install / Use
/learn @bugthesystem/Disque.NetREADME
Disque.Net
A simple .Net client for the Disque in-memory distributed queue https://github.com/antirez/disque
Disque is ongoing experiment to build a distributed, in memory, message broker. Its goal is to capture the essence of the "Redis as a jobs queue" use case, which is usually implemented using blocking list operations, and move it into an ad-hoc, self-contained, scalable, and fault tolerant design, with simple to understand properties and guarantees, but still resembling Redis in terms of simplicity, performances, and implementation as a C non-blocking networked server.
Installation
NuGet - Disque.Net
Install-Package Disque.Net
List of supported methods
- Ping
- Info
- Info by Section
- AddJob
- AddJob with Parameters
- GetJob
- GetJob with Parameters
- Ackjob
- Qlen
- Qpeek
- DelJob
- Dequeue
- Enqueue
- Fastack
- Show
- Working
Ping
var q = new DisqueClient(new Uri("disque://192.168.59.103:7711"));
string pong = q.Ping();
Info
var q = new DisqueClient(new Uri("disque://192.168.59.103:7711"));
string info = q.Info();
Info by Section
var q = new DisqueClient(new Uri("disque://192.168.59.103:7711"));
string info = q.Info("server");
AddJob
var q = new DisqueClient(new Uri("disque://192.168.59.103:7711"));
string jobId = q.AddJob("myqueue", "message", 10);
AddJob with Parameters
var q = new DisqueClient(new Uri("disque://192.168.59.103:7711"));
JobParams jobParams = new JobParams
{
Replicate = 1,
Retry = 10,
Ttl = 20,
Maxlen = 10,
Delay = 10,
Async = true
};
string jobId = q.AddJob("myqueue", "message", 10, jobParams);
GetJob
var q = new DisqueClient(new Uri("disque://192.168.59.103:7711"));
List<Job> jobs = q.GetJob("myqueue");
GetJob with Parameters
var q = new DisqueClient(new Uri("disque://192.168.59.103:7711"));
List<Job> jobs = q.GetJob(100, 2, "myqueue");
AckJob
var q = new DisqueClient(new Uri("disque://192.168.59.103:7711"));
string jobId = q.AddJob("myqueue", "message", 10);
long count = q.Ackjob(jobId);
Qlen
var q = new DisqueClient(new Uri("disque://192.168.59.103:7711"));
long qlen = q.Qlen("myqueue");
Qpeek
var q = new DisqueClient(new Uri("disque://192.168.59.103:7711"));
List<Job> jobs = q.Qpeek("myqueue", 2);
DelJob
var q = new DisqueClient(new Uri("disque://192.168.59.103:7711"));
string jobId = q.AddJob("myqueue", "testJob", 10);
long count = q.DelJob(jobId);
Dequeue
var q = new DisqueClient(new Uri("disque://192.168.59.103:7711"));
string jobId = q.AddJob("myqueue", "testJob", 10);
long count = q.Dequeue(jobId);
Enqueue
var q = new DisqueClient(new Uri("disque://192.168.59.103:7711"));
string jobId = q.AddJob("myqueue", "testJob", 10);
long count = q.Enqueue(jobId);
Fastack
var q = new DisqueClient(new Uri("disque://192.168.59.103:7711"));
string jobId = q.AddJob("fastack", "message", 10);
long count = q.Fastack(jobId);
Show
var q = new DisqueClient(new Uri("disque://192.168.59.103:7711"));
string jobId = q.AddJob("myqueue", "testJob", 10);
JobInfo info = q.Show(jobId);
Working
var q = new DisqueClient(new Uri("disque://192.168.59.103:7711"));
String jobId = q.AddJob("myqueue", "testJob", 10);
long secs = q.Working(jobId);
Bugs
If you encounter a bug, performance issue, or malfunction, please add an Issue with steps on how to reproduce the problem.
TODO
- Async methods
License
Code and documentation are available according to the MIT License (see LICENSE)
Related Skills
node-connect
349.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
