Skip to content

Commit

Permalink
doc: Add an example to the GitHub pages as not everyone might click o…
Browse files Browse the repository at this point in the history
…n the doc link (#21)
  • Loading branch information
gliga authored May 10, 2024
1 parent ad11606 commit e6b1e2c
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,31 @@ page](/examples/README.md). A quick demo of the very basic concepts
using a toy example is available [here](/doc/gobash.gif).


## A Quick Example

```bash
#!/bin/bash

# Import the library.
source /dev/stdin <<< "$(curl https://raw.githubusercontent.com/EngineeringSoftware/gobash/master/hsabog 2>/dev/null)"

# Create a communication channel.
ch=$(Chan)
# Send a message (blocking call) in a sub process.
( lst=$(List 2 3 5); $ch send "$lst" ) &

# Receive the message (blocking call) in the main process.
lst=$($ch recv)

$lst to_string
# Output:
# [
# "2",
# "3",
# "5"
# ]
```

## Key Features

We focused on a design that enables the following key features
Expand Down

0 comments on commit e6b1e2c

Please sign in to comment.