Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/jeamon/gorqs

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/jeamon/gorqs

  • v0.0.0-20231104233711-e81619e79c5c
  • Source
  • Go
  • Socket score

Version published
Created
Source

gorqs

Build Status godoc Go Report Card codecov GitHub go.mod Go version MIT License

gorqs means Go Runnable Queue Service. This is a multi-features go-based concurrent-safe library to queue & execute jobs and records their execution result. You can start the Queue service into synchronous or asynchronous mode. The mode defines wether each added job should be processed synchronously or asynchronously. Be aware that adding a job to the Queue system is always a non-blocking operation and returns the job id on success. Fetching a given job execution result removes that entry from local records cache.

Features

gorqs.New(gorqs.SyncMode | gorqs.TrackJobs) or gorqs.New(gorqs.AsyncMode | gorqs.TrackJobs) method provides a Queue object which implements the Queuer interface with below actions.

ActionDescription
Start(context.Context) errorstarts the jobs queue
Stop(context.Context) errorstops the jobs queue
Push(context.Context, Runner) (int64, error)adds a job to the queue asynchronously
Fetch(context.Context, int64) errorgets result execution of given job
IsRunning() boolprovides queue service status
Clear()delete all jobs results records

An acceptable runnable job should implement the Runner interface defined as below :

type Runner interface {
	Run() error
}

Installation

Just import the gorqs library as external package to start using it into your project. There are some examples into the examples folder.

[Step 1] - Download the package

$ go get github.com/jeamon/gorqs

[Step 2] - Import the package into your project

$ import "github.com/jeamon/gorqs"

[Step 3] - Optional: Clone the library to run some examples

$ git clone https://github.com/jeamon/gorqs.git
$ cd gorqs
$ go run examples/sync-mode/example.go
$ go run examples/async-mode/example.go

Contact

Feel free to reach out to me before any action. Feel free to connect on Twitter or linkedin

FAQs

Package last updated on 04 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc