Commit Graph

4 Commits

Author SHA1 Message Date
c5582275e7 context: realistic usage of context.
Use a go routine for the work logic. Here sleep and append to string.
Inside the go routine, select for ctx.Done(). If happens, just stop and
return.

In the outside function, select for ctx.Done() too. If it happens, that
means the work logic has not finished before canceled.
2024-09-21 20:35:43 +02:00
c0db9ab22b context: refactorize assert functions 2024-09-21 20:26:22 +02:00
0b181ccf0f context: setup timeout context 2024-09-21 20:20:15 +02:00
d49f952035 context: add basic context test 2024-09-21 20:07:09 +02:00