Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In Go, it is a single code path. Contexts can be canceled and they also come with propagating timeouts. The timeouts simply trigger a cancellation, so the only code path is handling cancellation.

There's nothing complicated about it, so there's no reason your code can't implement timeouts and cancellation the same way: timeouts are a cancellation triggered autonomously after some time passes.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: