Skip to content

This package help you run multiple functions over concurrency

Notifications You must be signed in to change notification settings

golang-common-packages/concurrency

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Concurrency

package main

import (
    "time"
    "fmt"
    
    "github.com/golang-common-packages/concurrency"
)

func main() {
    func1 := func() {
            for char := 'a'; char < 'a' + 3; char++ {
                fmt.Printf("%c ", char)
            }
    }
    
    func2 := func() {
            for number := 1; number < 4; number++ {
                fmt.Printf("%d ", number)
            }
    }

    Con := &Concurrency.Concurrent{}
    
    Con.Parallelize(func1, func2)  // a 1 b 2 c 3
    
    Con.ParallelizeTimeout(time.Minute, func1, func2)  // a 1 b 2 c 3
}

About

This package help you run multiple functions over concurrency

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages