Skip to content

Commit

Permalink
Update readme according to godoc
Browse files Browse the repository at this point in the history
  • Loading branch information
posener committed Apr 5, 2022
1 parent b2a7f08 commit afa4520
Showing 1 changed file with 38 additions and 2 deletions.
40 changes: 38 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,43 @@
# goworkers

[![Build Status](https://travis-ci.org/SlIdE42/goworkers.svg?branch=master)](https://travis-ci.org/SlIdE42/goworkers)
[![GitHub Workflow Status](https://github.com/SlIdE42/goworkers/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/SlIdE42/goworkers/actions/workflows/ci.yml?query=branch:master)
[![codecov](https://codecov.io/gh/SlIdE42/goworkers/branch/master/graph/badge.svg)](https://codecov.io/gh/SlIdE42/goworkers)
[![golangci](https://golangci.com/badges/github.com/SlIdE42/goworkers.svg)](https://golangci.com/r/github.com/SlIdE42/goworkers)
[![GoDoc](https://img.shields.io/badge/pkg.go.dev-doc-blue)](http://pkg.go.dev/github.com/SlIdE42/goworkers)
[![Go Report Card](https://goreportcard.com/badge/github.com/SlIdE42/goworkers)](https://goreportcard.com/report/github.com/SlIdE42/goworkers)

goworkers is a simple dynamic workers pool
goworkers is a simple but effecient dynamic workers pool

## Types

### type [Pool](/goworkers.go#L5)

`type Pool struct { ... }`

Pool is a workers pool

## Examples

```golang
ch := make(chan int)

pool := Init(func() {
i := <-ch
fmt.Println(i * i)
})

pool.Add(1)
ch <- 2
ch <- 3
wait := pool.Stop()
ch <- 4
<-wait
```

Output:

```
4
9
16
```

0 comments on commit afa4520

Please sign in to comment.