This repository contains the client library for working with Tarantool.Queue a full-fledged message broker for .NET nanoFramework.
| Component | Build Status | NuGet Package |
|---|---|---|
| nanoFramework.Tarantool.Queue |
Using a message queue, you can:
- Organize a distributed system of microcontrollers that share a common data bus.
- Organize an event-based system for exchanging information from various sensors and microcontrollers.
- Organize an archive of various system data and readings.
- Use different types of message queues to customize the necessary information processing logic.
Due to the limited memory size in the microcontroller, the message in the queue cannot be too large. To create and delete queues, you need to connect to Tarantool.Queue with the appropriate permissions.
The library supports all Tarantool.Queue types and all Queue module methods.
Samples:
- Taking a task from the queue ("consuming")
QueueClientOptions clientOptions = new QueueClientOptions($"{TarantoolHostIp}:3301"); using (IQueue queue = TarantoolQueueContext.Instance.GetQueue(clientOptions)) { ITube tube = queue["fifo_tube"]; TubeTask? tubeTask = null; Type messageInstaceType = typeof(SamleMessage); while ((tubeTask = tybe.Take(messageInstaceType)) != null) { try { //// Task processing.... //// ......... //// //// Acknowledging the completion processing of a task tube.Ack(messageInstaceType, tubeTask.TaskId); } catch(Exception ex) { //// Burying a task. If necessary, bury the erroneous task. tube.Bury(messageInstaceType, tubeTask.TaskId); //// or //// Delete task. //// tube.Delete(messageInstaceType, tubeTask.TaskId); Console.WriteLine(ex); } finaly { tubeTask = null; } } }
- Putting a task in a queue
QueueClientOptions clientOptions = new QueueClientOptions($"{TarantoolHostIp}:3301"); using (IQueue queue = TarantoolQueueContext.Instance.GetQueue(clientOptions)) { ITube tube = queue["fifo_tube"]; var sampleMessage = new SamleMessage(); try { tube.Put(sampleMessage); } catch(Exception ex) { Console.WriteLine(ex); } }
The initial version of the nanoFramework.Tarantool.Queue library was coded by Spirin Dmitriy, who has kindly handed over the library to the .NET nanoFramework project.
For documentation, providing feedback, issues, and finding out how to contribute, please refer to the Home repo.
Join our Discord community here.
The list of contributors to this project can be found at CONTRIBUTORS.
The nanoFramework WebServer library is licensed under the MIT license.
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behaviour in our community. For more information see the .NET Foundation Code of Conduct.
This project is supported by the .NET Foundation.