Skip to content

Instantly share code, notes, and snippets.

@kusa-mochi
Last active May 18, 2024 09:04
Show Gist options
  • Save kusa-mochi/28abfb45418385032ce86a5c710120b2 to your computer and use it in GitHub Desktop.
Save kusa-mochi/28abfb45418385032ce86a5c710120b2 to your computer and use it in GitHub Desktop.
@startuml go_channel
title チャネル利用例
hide footbox
participant ゴルーチンA as rA
participant ゴルーチンB as rB
rA -> rA : チャネル生成
rA -> rB ** : チャネル
rB -> rB : チャネル読み込み\n(メッセージが来るまで待機)
rA -> rA : 何らかの処理
rA -> rB : チャネルでメッセージを送る
rB -> rB : メッセージを受けて何らかの処理をする
@enduml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment