Skip to content

Golang concurrency library for noobs like a me (Vay3t)

License

Notifications You must be signed in to change notification settings

nchgroup/goncurrent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Goncurrent

Golang concurrency library for noobs like a me (Vay3t)

How works

This library is a wrapper of the goroutines, it's very simple to use, you only need to pass the number of threads, a list and a function, the library will do the rest.

How to use

package main

import (
	"fmt"
	"time"

	"github.com/nchgroup/goncurrent"
)

func main() {
	threads := 5

	// create a custom list with whatever type you want
	list := []string{"hello", "world", "from", "go", "goroutines"}

	goncurrent.Execute(threads, list, func(item interface{}) { // don't edit this line

		// you can write whatever
		fmt.Println(item)
		time.Sleep(1 * time.Second)
		// end whatever

	})
}

Authors

Releases

No releases published

Packages

No packages published

Languages