惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Forbes - Security
Forbes - Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
N
Netflix TechBlog - Medium
Engineering at Meta
Engineering at Meta
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
F
Fortinet All Blogs
P
Privacy & Cybersecurity Law Blog
The Hacker News
The Hacker News
博客园 - 司徒正美
博客园 - 聂微东
T
The Blog of Author Tim Ferriss
I
Intezer
WordPress大学
WordPress大学
Security Archives - TechRepublic
Security Archives - TechRepublic
Scott Helme
Scott Helme
T
Threat Research - Cisco Blogs
T
Tailwind CSS Blog
月光博客
月光博客
Recent Announcements
Recent Announcements
博客园 - 叶小钗
J
Java Code Geeks
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
L
LINUX DO - 热门话题
Google DeepMind News
Google DeepMind News
C
Cyber Attacks, Cyber Crime and Cyber Security
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
N
News and Events Feed by Topic
A
Arctic Wolf
B
Blog RSS Feed
Recorded Future
Recorded Future
D
DataBreaches.Net
有赞技术团队
有赞技术团队
Project Zero
Project Zero
U
Unit 42
T
Tor Project blog
The GitHub Blog
The GitHub Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
C
CERT Recently Published Vulnerability Notes
博客园 - Franky
博客园 - 【当耐特】
Microsoft Security Blog
Microsoft Security Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Security Latest
Security Latest
C
Cisco Blogs
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Blog — PlanetScale
Blog — PlanetScale
H
Heimdal Security Blog
Vercel News
Vercel News
Stack Overflow Blog
Stack Overflow Blog
S
Securelist

浩瀚星河 - 个人技术博客

工作中如何做好技术积累 wrk压测工具 千万级 Mysql 表结构变更实战 MySql主从复制 Go遍历时删除特定元素 Golang中的优雅关闭与退出 Github CI自动发版 git-filter-repo 清理敏感信息 初识mcp server 短视频的推荐算法 webhook是什么 GitLab Runner 使用与 CICD 全面指南 Go Zap实现日志双写和切割 canal安装与使用 kafka-go使用 go-elasticsearch使用指南 elasticsearch安装与使用 kratos中proto文件引入其他proto爆红 go中的defer 腾讯云发送短信 什么是勇敢 go中的方法提升 docker部署mysql中文乱码问题 10万行报表导出优化实战:从 OFFSET 到游标分页 不急于求成,才是最长远的成长 redis在go中的实践 go 反射 go timer定时器 go context学习之旅 go jwt和redis实现用户登录注册以及查询 go中的panic和recover channel的select case控制语句 channel之生产者消费者模型 缓冲区为 1 和无缓冲区的 channel 有什么区别 channel 基本概念 使用minio的go sdk上传文件 wire优雅的管理go项目
channel实现简易eventbus
浩瀚星河 · 2025-08-07 · via 浩瀚星河 - 个人技术博客

本文介绍了一个适用于单机模块的 Go 语言事件总线(Eventbus)实现,用于异步事件的发布与订阅。通过 map[string]*EventChans 管理事件与多个通道的映射关系,并结合读写锁 sync.RWMutex 保证并发安全,实现了 Subscribe、UnSubscribe、Publish 三个核心方法,展示了如何安全高效地进行事件分发。适合 Go 初学者理解 channel 和并发控制。