# What can I use cff for?

Here are some examples of what you can use cff for:

  • Run interdependent functions concurrently, with a guarantee that a function does not run before its dependencies.

    For example, with cff you can send requests to two different APIs, feed results from them into requests made to five other APIs, some of which feed into one another, and so on, until it all feeds back into two structs that represent the result.

    And do all of this with as much concurrency as possible from the dependency relationships.

    Use cff.Flow for this.

  • Run independent functions concurrently.

    You can choose whether you want to stop when the first of them fails, or keep going despite failures.

    Use cff.Parallel for this.

  • Run the same function on every element of a map or a slice, without risk of unbounded goroutine growth.

    Use cff.Parallel with cff.Slice or cff.Map for this.

See also What can't I use cff for?

Last Updated: 5/14/2024, 10:59:03 PM