MCPcopy
hub / github.com/jackc/pgx / BenchmarkContextWatcherUncancellable

Function BenchmarkContextWatcherUncancellable

pgconn/ctxwatch/context_watcher_test.go:155–162  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

153}
154
155func BenchmarkContextWatcherUncancellable(b *testing.B) {
156 cw := ctxwatch.NewContextWatcher(&testHandler{handleCancel: func(context.Context) {}, handleUnwatchAfterCancel: func() {}})
157
158 for b.Loop() {
159 cw.Watch(context.Background())
160 cw.Unwatch()
161 }
162}
163
164func BenchmarkContextWatcherCancelled(b *testing.B) {
165 cw := ctxwatch.NewContextWatcher(&testHandler{handleCancel: func(context.Context) {}, handleUnwatchAfterCancel: func() {}})

Callers

nothing calls this directly

Calls 3

WatchMethod · 0.95
UnwatchMethod · 0.95
NewContextWatcherFunction · 0.92

Tested by

no test coverage detected