aboutsummaryrefslogtreecommitdiff
path: root/api/channels.md
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-08-18 20:28:16 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-08-18 20:28:39 -0400
commitd804b09b02b9c4a6ea6b16ae85524a704796cbc1 (patch)
tree3379d64b028a80825a892c87176b6bb6d6cc3484 /api/channels.md
parentc338c3f08c6a13242e975dd344bad63a3cec9eee (diff)
Added a .length field to arrays/sets/tables, added a .max_size field to
channels, and updated the API
Diffstat (limited to 'api/channels.md')
-rw-r--r--api/channels.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/api/channels.md b/api/channels.md
index 4b8d416a..48116dc5 100644
--- a/api/channels.md
+++ b/api/channels.md
@@ -5,13 +5,13 @@ although they can also be used as a general-purpose queue.
## Syntax
-The syntax to create a channel is `|T|`, where `T` is the type that will be
+The syntax to create a channel is `|:T|`, where `T` is the type that will be
passed through the channel. You can also specify a maximum size for the
channel, which will cause pushing to block until the recipient has popped from
the channel if the maximum size is reached.
```tomo
-channel := |Int|
+channel := |:Int|
channel:push(10)
channel:push(20)
>> channel:pop()
@@ -19,7 +19,7 @@ channel:push(20)
>> channel:pop()
= 20
-small_channel := |Int; max_size=5|
+small_channel := |:Int; max_size=5|
```
## Channel Methods