All Projects → alexsniffin → gosd

alexsniffin / gosd

Licence: MIT license
A library for scheduling when to dispatch a message to a channel

Programming Languages

go
31211 projects - #10 most used programming language
Dockerfile
14818 projects
Makefile
30231 projects

Projects that are alternatives of or similar to gosd

tgip
TGIP (TGI Pulsar) is a weekly live video streaming about Apache Pulsar and its ecosystem.
Stars: ✭ 17 (-19.05%)
Mutual labels:  messaging
delay-timer
Time-manager of delayed tasks. Like crontab, but synchronous asynchronous tasks are possible scheduling, and dynamic add/cancel/remove is supported.
Stars: ✭ 257 (+1123.81%)
Mutual labels:  scheduling
saisoku
Saisoku is a Python module that helps you build complex pipelines of batch file/directory transfer/sync jobs.
Stars: ✭ 40 (+90.48%)
Mutual labels:  scheduling
iGap-iOS
iGap Client for iOS Source Code
Stars: ✭ 18 (-14.29%)
Mutual labels:  messaging
qpid-cpp
Mirror of Apache Qpid C++
Stars: ✭ 77 (+266.67%)
Mutual labels:  messaging
awesome-integration
A curated list of awesome system integration software and resources.
Stars: ✭ 117 (+457.14%)
Mutual labels:  messaging
WatsonCluster
A simple C# class using Watson TCP to enable a one-to-one high availability cluster.
Stars: ✭ 18 (-14.29%)
Mutual labels:  messaging
numspy
A python module for sending free sms as well as finding details of mobile number via website Way2sms.
Stars: ✭ 57 (+171.43%)
Mutual labels:  messaging
Flow-Shop-Scheduling-Based-On-Reinforcement-Learning-Algorithm
Operations Research Application Project - Flow Shop Scheduling Based On Reinforcement Learning Algorithm
Stars: ✭ 73 (+247.62%)
Mutual labels:  scheduling
Muni
Chat with Cloud Firestore
Stars: ✭ 22 (+4.76%)
Mutual labels:  messaging
azure-service-bus-java
☁️ Java client library for Azure Service Bus
Stars: ✭ 61 (+190.48%)
Mutual labels:  messaging
streamsx.kafka
Repository for integration with Apache Kafka
Stars: ✭ 13 (-38.1%)
Mutual labels:  messaging
qpid-broker-j
Mirror of Apache Qpid Broker-J
Stars: ✭ 52 (+147.62%)
Mutual labels:  messaging
wat
How fast are computers?
Stars: ✭ 26 (+23.81%)
Mutual labels:  scheduling
task-bundle
Scheduling of tasks for symfony made simple
Stars: ✭ 33 (+57.14%)
Mutual labels:  scheduling
aop
AMQP on Pulsar protocol handler
Stars: ✭ 93 (+342.86%)
Mutual labels:  messaging
croner
Trigger functions and/or evaluate cron expressions in JavaScript. No dependencies. Most features. All environments.
Stars: ✭ 169 (+704.76%)
Mutual labels:  scheduling
gobroker
golang wrapper for all (to-be) kinds of message brokers
Stars: ✭ 15 (-28.57%)
Mutual labels:  messaging
qpid-python
Mirror of Apache Qpid Python
Stars: ✭ 15 (-28.57%)
Mutual labels:  messaging
vent
Vent is a light-weight platform built to automate network collection and analysis pipelines using a flexible set of popular open source tools and technologies. Vent is python-based, extensible, leverages docker containers, and provides both an API and CLI.
Stars: ✭ 73 (+247.62%)
Mutual labels:  scheduling

gosd

Mentioned in Awesome Go Build Status Go Report Card codecov

go-schedulable-dispatcher (gosd), is a library for scheduling when to dispatch a message to a channel.

Implementation

The implementation provides an interactive API to handle scheduling messages with a dispatcher. Messages are ingested and processed into a heap based priority queue. Order is not guaranteed by default when messages have the same scheduled time, but can be changed through the config. By guaranteeing order, performance will be slightly worse. If strict-ordering isn't critical to your application, it's recommended to keep the default setting.

Example

// create instance of dispatcher
dispatcher, err := gosd.NewDispatcher[string](&gosd.DispatcherConfig{
    IngressChannelSize:  100,
    DispatchChannelSize: 100,
    MaxMessages:         100,
    GuaranteeOrder:      false,
})
checkErr(err)

// spawn process
go dispatcher.Start()

// schedule a message
dispatcher.IngressChannel() <- &gosd.ScheduledMessage[string]{
    At:      time.Now().Add(1 * time.Second),
    Message: "Hello World in 1 second!",
}

// wait for the message
msg := <-dispatcher.DispatchChannel()

fmt.Println(msg)
// Hello World in 1 second!

// shutdown without deadline
dispatcher.Shutdown(context.Background(), false)

More examples under examples.

Benchmarking

Tested with Go 1.19 and 1000 messages per iteration.

goos: windows
goarch: amd64
pkg: github.com/alexsniffin/gosd/v2
cpu: Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
Benchmark_integration_unordered
Benchmark_integration_unordered-12                           307           3690528 ns/op
Benchmark_integration_unorderedSmallBuffer
Benchmark_integration_unorderedSmallBuffer-12                274           4120104 ns/op
Benchmark_integration_unorderedSmallHeap
Benchmark_integration_unorderedSmallHeap-12                  348           3452703 ns/op
Benchmark_integration_ordered
Benchmark_integration_ordered-12                             135           8650709 ns/op
Benchmark_integration_orderedSmallBuffer
Benchmark_integration_orderedSmallBuffer-12                  207           5867338 ns/op
Benchmark_integration_orderedSmallHeap
Benchmark_integration_orderedSmallHeap-12                    350           3592990 ns/op
Benchmark_integration_orderedSameTime
Benchmark_integration_orderedSameTime-12                     133           8909311 ns/op
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].