QueueBroadcase

command module
v0.0.0-...-53f521c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2023 License: MIT Imports: 6 Imported by: 0

README

QueueBroadcase

相邻节点逐一启动,消息通过相邻的节点顺序传递,达到广播目标。

目标

相邻节点逐一启动,消息通过相邻的节点逐一进行广播
节点会把信息传递给相邻的节点,相邻的节点再把信息传递给它相邻的节点,以此类推。
如果其中一个节点下线,他相邻的节点将无法获取信息,重写将其上线,则可以恢复通讯。

节点参数

启动多个相邻的节点
节点的id是参数
节点的Address是loacalhost
节点的port是8000+id

例如

# 开启多个窗口并运行代码,参数为id,数字需要相邻
go run . 1
go run . 2
go run . 3
go run . 4
go run . 5
结构
Node[Id:1]  -->  Node[Id:2] --> Node[Id:3] --> Node[Id:4] --> Node[Id:5]

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL