draining

package
Version: v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package draining implements a draining state on contexts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func C

func C(ctx context.Context) <-chan struct{}

C returns a channel associated with the draining context. The channel is closed when the context is draining. If the context is not set up for draining, return nil (nil channels block forever on receive).

func IsDraining

func IsDraining(ctx context.Context) bool

IsDraining checks whether the context is draining. If the context is not set up for draining, return false.

func WithDraining

func WithDraining(ctx context.Context) (context.Context, func())

WithDraining returns a context that can be marked as draining by calling the returned function.

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

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