• Stars
    star
    14
  • Rank 1,390,797 (Top 29 %)
  • Language
    Go
  • License
    MIT License
  • Created over 5 years ago
  • Updated almost 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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.

More Repositories

1

scdownload

A full featured soundcloud downloader, supports downloading playlists and single track. Downloads, even if the track is not downloadable!
Go
9
star
2

wsh

A shell for ignoring Android linker warning on termux!
Go
8
star
3

stackoverflow-scraper-messenger-bot

A messenger bot that answers messages by scraping stackoverflow questions and answers
Go
7
star
4

html2vecty

HTML to Vecty compiler! 😎 Transpiles all of your html codes to vecty components in a second! 😎 #move2vecty #html2vecty
Go
6
star
5

bing

package bing provides web search functionalities by scraping bing search engine.
Go
5
star
6

vectydoc

Documentation for github.com/gopherjs/vecty . Also contains various vecty examples! 😎
5
star
7

crtscan

Scan subdomains from certificate transparency logs (https://crt.sh)
Go
4
star
8

jsdoc

A godoc like cli tool for nodejs documentation. Built with golang, works for nodejs!
Go
4
star
9

gocgi

Library for running golang and php (cgi) in a single port/service/server!
Go
2
star
10

gocall

Package gocall gives you the ability to create your own out of the box load balancer and API gateway!
Go
2
star
11

subdomain-takeover

Python Tools For Checking Subdomain TakeOver Vulnerbility
Python
2
star
12

sure

Package sure helps you to use interfaces with more confidence. It returns zero value when the confidence is not so good enough!
Go
1
star
13

voot

A simple synchronized in memory key value data storer in Golang
Go
1
star
14

neo

A large file reading assistant for terminal.
Go
1
star
15

WAF-Bypassing-Deface

This repository contains scripts that can be used to deface such websites that supports php but no web shells!
PHP
1
star