goflow#

Go library for building concurrent applications with rate limiting, task scheduling, and streaming.

New to goflow? Read Why goflow to understand the problem space and architecture.

Installation#

go get github.com/vnykmshr/goflow

Quick Example#

package main

import (
    "context"
    "log"

    "github.com/vnykmshr/goflow/pkg/ratelimit/bucket"
    "github.com/vnykmshr/goflow/pkg/scheduling/workerpool"
)

func main() {
    limiter, _ := bucket.NewSafe(100, 200)
    pool, _ := workerpool.NewSafe(5, 100)
    defer func() { <-pool.Shutdown() }()

    if limiter.Allow() {
        pool.Submit(workerpool.TaskFunc(func(ctx context.Context) error {
            log.Println("Processing request")
            return nil
        }))
    }
}

Documentation#

Guides

Features

Reference

Resources#