GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - uber-go/cff: Concurrency toolkit for Go

BranchesTags
Open more actions menu

Latest commit

 

History

357 Commits
357 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
assets
assets
 
 
cmd/cff
cmd/cff
 
 
docs
docs
 
 
examples
examples
 
 
internal
internal
 
 
scheduler
scheduler
 
 
tools
tools
 
 
.codecov.yml
.codecov.yml
 
 
.gitignore
.gitignore
 
 
.golangci.yml
.golangci.yml
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
NOTICE
NOTICE
 
 
README.md
README.md
 
 
cff.go
cff.go
 
 
directive_type.go
directive_type.go
 
 
directive_type_test.go
directive_type_test.go
 
 
emitter.go
emitter.go
 
 
emitter_stack.go
emitter_stack.go
 
 
emitter_stack_test.go
emitter_stack_test.go
 
 
error.go
error.go
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
nop_emitter.go
nop_emitter.go
 
 
nop_emitter_test.go
nop_emitter_test.go
 
 
scheduler.go
scheduler.go
 
 
scheduler_export_test.go
scheduler_export_test.go
 
 
scheduler_test.go
scheduler_test.go
 
 

Repository files navigation

cff: a concurrency toolkit for Go

cff logo

cff (pronounce caff as in caffeine) is a library and code generator for Go that makes it easy to write concurrent code in Go.

It gives you:

  • Bounded resource consumption: cff uses a pool of goroutines to run all operations, preventing issues arising from unbounded goroutine growth in your application.
  • Panic-safety: cff prevents panics in your concurrent code from crashing your application in a predictable manner.

cff can be useful when you are trying to:

  1. Run interdependent functions concurrently, with a guarantee that a function does not run before its dependencies.
flowchart LR
  A; B; C; D; E; F; G
  dots1[...]; dots2[...]
  X; Y;

  A & B --> C
  B --> D & E
  A & C --> F
  C & D & E --> G
  F & G --> dots1
  G & E --> dots2

  dots1 --> X
  dots2 --> Y

  style dots1 fill:none,stroke:none
  style dots2 fill:none,stroke:none
Loading
  1. Run independent functions concurrently.
flowchart TD
  A; B; dots[...]; H

  done(( Done ))

  A --> done
  B --Error--x done
  dots -.-> done
  H --> done

  style done fill:none,stroke:none
  style dots fill:none,stroke:none
Loading
  1. Run the same function on every element of a map or a slice, without risk of unbounded goroutine growth.
flowchart RL
  subgraph Slice ["[]T"]
    i0["x1"]; i1["x2"]; dots1[...]; iN["xN"]
    style dots1 fill:none,stroke:none
  end

  subgraph Map ["map[K]V"]
    m1["(k1, v1)"]; m2["(k2, v2)"]; dots2[...]; mN["(kN, vN)"]
    style dots2 fill:none,stroke:none
  end

  subgraph Workers
    direction LR
    1; 2
  end

  Slice & Map -.-> Workers
Loading

See our documentation at https://uber-go.github.io/cff for more information.

Installation

go get -u go.uber.org/cff

Project status

At Uber, we've been using cff in production for several years. We're confident in the stability of its core functionality.

Although its APIs have satisfied a majority of our needs, we expect to add or modify some of these once the project is public.

That said, we intend to make these changes in compliance with Semantic Versioning.

License

cff is licensed under the Apache 2.0 license. See the LICENSE file for more information.

About

Concurrency toolkit for Go

uber-go.github.io/cff

Topics

code-generatorconcurrencygolang

Resources

Readme
Apache-2.0 license

Contributing

Contributing
Activity
Custom properties

Stars

236 stars

Watchers

6 watching

Forks

10 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.