Add overwrite option to channel send to enable ring-buffer like behavior#82
Add overwrite option to channel send to enable ring-buffer like behavior#82elcritch wants to merge 14 commits intonim-lang:masterfrom
overwrite option to channel send to enable ring-buffer like behavior#82Conversation
|
|
I sorta like Claude gives me:
|
6f84519 to
3b4e858
Compare
In some cases it's useful to have a channel which acts as a ring-buffer that overwrites the oldest data.
For example in UIs you often want the last mouse input. The alternatives like calling
tryRecvand thensendrequire taking the lock multiple times and adds odd edge-cases.Alternatively this could be made into a new proc
sendOverwriteorforceSendassend(ch, val, overwrite=true)is no longer blocking in a sense.