Skip to content

Commit

Permalink
feat: add new Terrastruct application configuration and images
Browse files Browse the repository at this point in the history
- Add a flowchart image to the README
- Remove an old image from the repository
- Add a new configuration file for a Terrastruct application, including a queue and workers

Signed-off-by: Bo-Yi.Wu <[email protected]>
  • Loading branch information
appleboy committed Apr 2, 2023
1 parent 414c6c2 commit af71d0b
Show file tree
Hide file tree
Showing 4 changed files with 235 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Queue is a Golang library for spawning and managing a Goroutine pool, allowing y

In Single Container or VM

![queue01](./images/queue-01.png)
![queue01](./images/flow.svg)

Multile Container with Queue service like NSQ, NATs or Redis

Expand Down
102 changes: 102 additions & 0 deletions images/flow.d2
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
direction: right

user01: User01 {
shape: person
style.multiple: true
}

user02: User02 {
shape: person
style.multiple: true
}

user03: User03 {
shape: person
style.multiple: true
}

user01 -> container.task01: Create Task {
style:{
animated: true
bold: true
font-size: 28
}
}
user02 -> container.task02: Create Task{
style:{
animated: true
bold: true
font-size: 28
}
}
user03 -> container.task03: Create Task{
style:{
animated: true
bold: true
font-size: 28
}
}

container: Application {
direction: right
icon: https://icons.terrastruct.com/dev%2Fgo.svg

task01: {
icon: https://icons.terrastruct.com/essentials%2F092-graph%20bar.svg
style.multiple: true
}

task02: {
icon: https://icons.terrastruct.com/essentials%2F095-download.svg
style.multiple: true
}

task03: {
icon: https://icons.terrastruct.com/essentials%2F195-attachment.svg
style.multiple: true
}

queue: Queue Library {
icon: https://icons.terrastruct.com/dev%2Fgo.svg
producer: Producer {

}

consumer: Consumer {

}

channel: Ring Buffer {
shape: cylinder
}

producer -> channel
channel -> consumer
}



worker01: {
icon: https://icons.terrastruct.com/essentials%2F092-graph%20bar.svg
}

worker02: {
icon: https://icons.terrastruct.com/essentials%2F095-download.svg
}

worker03: {
icon: https://icons.terrastruct.com/essentials%2F092-graph%20bar.svg
}

worker04: {
icon: https://icons.terrastruct.com/essentials%2F195-attachment.svg
}

task01 -> queue.producer: Enqueue Task
task02 -> queue.producer: Enqueue Task
task03 -> queue.producer: Enqueue Task
queue.consumer -> worker01: dispatch task
queue.consumer -> worker02: dispatch task
queue.consumer -> worker03: dispatch task
queue.consumer -> worker04: dispatch task
}
Loading

0 comments on commit af71d0b

Please sign in to comment.