Package queue gives you a queue group accessibility

queue

-- import "github.com/anikhasibul/queue"

package queue gives you a queue group accessibility. Helps you to limit goroutines, wait for the end of the all goroutines and much more...

maxRoutines := 50
q := queue.New(maxRoutines)
defer q.Close()
for i := 0; i != 1000; i++ {
	q.Add()
	go func(c int) {
		defer q.Done()
		fmt.Println(c)
	}(i)
}
//wait for the end of the all jobs
q.Wait()

Usage

type Q

type Q struct {
}

Q holds a queue group and it's essentials.

func New

func New(max int) *Q

New creates a new queue group. It takes max running jobs as a parameter.

func (*Q) Add

func (q *Q) Add()

Add adds a new job to the queue.

func (*Q) Done

func (q *Q) Done()

Done decrements the queue group counter.

func (*Q) Wait

func (q *Q) Wait()

Wait waits for the end of the all jobs.

func (*Q) Current

func (q *Q) Current() int

Current returns the number of current running jobs.

func (*Q) Close

func (q *Q) Close()

Close closes a queue group gracefully.

Similar Resources

personal tweet scheduler - it needs my guidance now for it to work for you - it works on my mac - will release it someday

tit tit daemon write tests automate build & install plist replace {{path_for_titd_executable}} accordingly. ?xml version="1.0" encoding="UTF-8"? !D

Feb 4, 2022

Gron - gron transforms JSON into discrete assignments to make it easier to grep for what you want and see the absolute 'path' to it

gron Make JSON greppable! gron transforms JSON into discrete assignments to make

Feb 14, 2022

Reminder is a Golang package to allow users to schedule alerts.

Reminder is a Golang package to allow users to schedule alerts. It has 4 parts: Scheduler Repeater Notifier Reminder A scheduler takes in a t

Sep 28, 2022

goCron: A Golang Job Scheduling Package.

goCron: A Golang Job Scheduling Package.

Jan 9, 2023

Package tasks is an easy to use in-process scheduler for recurring tasks in Go

Tasks Package tasks is an easy to use in-process scheduler for recurring tasks in Go. Tasks is focused on high frequency tasks that run quick, and oft

Dec 18, 2022

This package provides the way to get the previous timestamp or the next timestamp that satisfies the cron expression.

Cron expression parser Given a cron expression, you can get the previous timestamp or the next timestamp that satisfies the cron expression. I have us

May 3, 2022

Scheduler - Scheduler package is a zero-dependency scheduling library for Go

Scheduler Scheduler package is a zero-dependency scheduling library for Go Insta

Jan 14, 2022

lightning - forward messages between a qq group and a telegram group

lightning The purpose of this project is to forward messages between a qq group and a telegram group. Getting Started Clone this project: git clone ht

Nov 9, 2022

A tool for checking the accessibility of your data by IPFS peers

ipfs-check Check if you can find your content on IPFS A tool for checking the accessibility of your data by IPFS peers Documentation Build go build wi

Dec 17, 2022

Configure is a Go package that gives you easy configuration of your project through redundancy

Configure Configure is a Go package that gives you easy configuration of your project through redundancy. It has an API inspired by negroni and the fl

Sep 26, 2022

Bubbly is an open-source platform that gives you confidence in your continuous release process.

Bubbly is an open-source platform that gives you confidence in your continuous release process.

Bubbly Bubbly - Release Readiness in a Bubble Bubbly emerged from a need that many lean software teams practicing Continuous Integration and Delivery

Nov 29, 2022

Pixie gives you instant visibility by giving access to metrics, events, traces and logs without changing code.

Pixie gives you instant visibility by giving access to metrics, events, traces and logs without changing code.

Pixie gives you instant visibility by giving access to metrics, events, traces and logs without changing code.

Jan 4, 2023

A cowin bot that gives you an update whenever it finds a vacancy in your region

go-cowin-bot A cowin bot that will give you an update on discord whenever it finds a vacancy for the parameters provided Setup: download go-cowin-bot

Mar 29, 2022

Gowl is a process management and process monitoring tool at once. An infinite worker pool gives you the ability to control the pool and processes and monitor their status.

Gowl is a process management and process monitoring tool at once. An infinite worker pool gives you the ability to control the pool and processes and monitor their status.

Gowl is a process management and process monitoring tool at once. An infinite worker pool gives you the ability to control the pool and processes and monitor their status.

Nov 10, 2022

Emulate a Vikings War of Clans battle with the real game mechanics and gives you the results of your emulated rapport!

VikingsStatsCalc Emulate a Vikings War of Clans battle with the real game mechanics and gives you the results of your emulated rapport! TODO Introduce

Nov 18, 2022

The sntr command-line program gives you convenient access to Sentry directly from your terminal.

sntr: all of Sentry at your fingertips The sntr command-line program gives you convenient access to Sentry directly from your terminal. Disclaimer: th

Jan 31, 2022

Peimports - based on golang's debug/pe this package gives quick access to the ordered imports of pe files with ordinal support

This code is almost entirely derived from the Go standard library's debug/pe package. It didn't provide access to ordinal based entries in the IAT and

Jan 5, 2022

Chat app that allows you to group multiple channels into one view.

hashchat Backend service Getting Started Essential steps to get your backend service deployed A helloworld example has been shipped with the template

Dec 13, 2021

This application is a tool that allows you to prepare mail designs specific to your group and make Christmas raffles.

What is this? This application is a tool that allows you to prepare mail designs specific to your group and make Christmas raffles. How is it working?

Dec 15, 2022
A lightweight job scheduler based on priority queue with timeout, retry, replica, context cancellation and easy semantics for job chaining. Build for golang web apps.

Table of Contents Introduction What is RIO? Concern An asynchronous job processor Easy management of these goroutines and chaining them Introduction W

Dec 9, 2022
YTask is an asynchronous task queue for handling distributed jobs in golang
YTask is an asynchronous task queue for handling distributed jobs in golang

YTask is an asynchronous task queue for handling distributed jobs in golang

Dec 24, 2022
Fulfills a GitHub workflow_job webhooks into a Pub/Sub queue.

GitHub Workflow Job to Pub/Sub The GitHub Workflow Job to Pub/Sub is a small service that fulfills a GitHub workflow_job webhook. When a job is queued

Mar 3, 2022
a self terminating concurrent job queue for indeterminate workloads in golang

jobtracker - a self terminating concurrent job queue for indeterminate workloads in golang This library is primarily useful for technically-recursive

Sep 6, 2022
Redisq is a queue-over-redis that provides simple way to works with queues stored in Redis.

Redisq is a queue-over-redis that provides simple way to works with queues stored in Redis.

Feb 10, 2022
Gotask - A simple task queue is stripped when the program is written to achieve the task delivery function
Gotask - A simple task queue is stripped when the program is written to achieve the task delivery function

gotask The simple task queue is stripped when the program is written to achieve

Feb 14, 2022
You had one job, or more then one, which can be done in steps

Leprechaun Leprechaun is tool where you can schedule your recurring tasks to be performed over and over. In Leprechaun tasks are recipes, lets observe

Nov 23, 2022
Chrono is a scheduler library that lets you run your task and code periodically
Chrono is a scheduler library that lets you run your task and code periodically

Chrono is a scheduler library that lets you run your tasks and code periodically. It provides different scheduling functionalities to make it easier t

Dec 26, 2022
go-sche is a golang library that lets you schedule your task to be executed later.

go-sche is a golang library that lets you schedule your task to be executed later.

Dec 24, 2022
This app can extend developer mode timer for the LG TV (you'll need the session token for that)

LG WebOS Developer Mode Extender This app can extend developer mode timer for the LG TV (you'll need the session token for that) You can obtain the de

Dec 17, 2021