#With-Timeout

1 articles

Recognizing Package Context With Timeout In Golang

Recognizing Package Context With Timeout In Golang

Package introduction context.WithTimeout

In the previous article we learned context.WithCancel where we manually send the cancel signal from context. But we can also add cancel signal to context automatically by using timeout timings. By using timeout, we no longer need to manually call cancel execution, but with timeout cancel will be automatically executed if the timeout time has passed.