async

package
v0.0.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2023 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Goroutine

func Goroutine(n int, input func(*chan any), process func(...any))

Goroutine asynchronous processing of data in chan

Example
package main

import (
	"fmt"
	"github.com/sechelper/seclib/async"
)

func main() {
	input := func(c *chan any) {
		for i := 0; i <= 100000; i++ {
			*c <- i
		}
	}

	process := func(p ...any) {
		fmt.Println(p[0])
	}

	async.Goroutine(30, input, process)

}
Output:

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL