rpctimeout

package
v0.0.0-...-cd54735 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: MIT Imports: 2 Imported by: 1

Documentation

Overview

Package rpctimeout provides helpers to have timeouts on rpc streams.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, timeout time.Duration, fn func(ctx context.Context) error) error

Run runs the provided function with a context that will be canceled after the provided duration or when the provided function returns. It returns either the error from the context or the error from the function. It runs the function in its own goroutine and DOES NOT wait for it to exit. This is on purpose to get around some grpc brain damage with respect to canceling operations on server streams.

Types

This section is empty.

Jump to

Keyboard shortcuts

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