{"id":24293694,"url":"https://github.com/kercylan98/vivid","last_synced_at":"2026-01-18T10:22:47.843Z","repository":{"id":272162320,"uuid":"915633078","full_name":"kercylan98/vivid","owner":"kercylan98","description":"High-performance, type-safe Actor model library for Go. Features transparent message passing, remoting, supervision strategies, and built-in scheduler.","archived":false,"fork":false,"pushed_at":"2026-01-11T07:22:09.000Z","size":3851,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-11T13:28:19.825Z","etag":null,"topics":["actor","actor-framework","actor-model","actor-system","concurrency","distributed-systems","event-driven","go","golang","message-passing","microservices","remoting","scheduler","supervision"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kercylan98.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-12T11:53:58.000Z","updated_at":"2026-01-11T07:22:13.000Z","dependencies_parsed_at":"2025-01-12T16:32:03.944Z","dependency_job_id":"cab99289-b308-49d9-9260-dd5e4191dfe1","html_url":"https://github.com/kercylan98/vivid","commit_stats":null,"previous_names":["kercylan98/vivid"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/kercylan98/vivid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kercylan98%2Fvivid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kercylan98%2Fvivid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kercylan98%2Fvivid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kercylan98%2Fvivid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kercylan98","download_url":"https://codeload.github.com/kercylan98/vivid/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kercylan98%2Fvivid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28534339,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T10:13:46.436Z","status":"ssl_error","status_checked_at":"2026-01-18T10:13:11.045Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actor","actor-framework","actor-model","actor-system","concurrency","distributed-systems","event-driven","go","golang","message-passing","microservices","remoting","scheduler","supervision"],"created_at":"2025-01-16T16:54:56.337Z","updated_at":"2026-01-18T10:22:47.831Z","avatar_url":"https://github.com/kercylan98.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"assets/logo.svg\" alt=\"Vivid Logo\" width=\"120\"\u003e\n  \n  # Vivid\n\u003c/div\u003e\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/kercylan98/vivid.svg)](https://pkg.go.dev/github.com/kercylan98/vivid)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Go Version](https://img.shields.io/badge/Go-1.25.1+-00ADD8?style=flat\u0026logo=go)](https://golang.org)\n[![Go Report Card](https://goreportcard.com/badge/github.com/kercylan98/vivid)](https://goreportcard.com/report/github.com/kercylan98/vivid)\n\n[![GitHub release](https://img.shields.io/github/release/kercylan98/vivid.svg)](https://github.com/kercylan98/vivid/releases)\n[![GitHub stars](https://img.shields.io/github/stars/kercylan98/vivid.svg?style=social\u0026label=Stars)](https://github.com/kercylan98/vivid)\n[![GitHub issues](https://img.shields.io/github/issues/kercylan98/vivid.svg)](https://github.com/kercylan98/vivid/issues)\n[![GitHub pull requests](https://img.shields.io/github/issues-pr/kercylan98/vivid.svg)](https://github.com/kercylan98/vivid/pulls)\n\nVivid 是一个高性能、类型安全的 Go 语言 Actor 模型实现库，提供了完整的 Actor 系统、消息传递、远程通信、监督策略等核心功能，帮助开发者构建可扩展、高并发的分布式应用。\n\n\u003e **注意**：本项目目前处于活跃开发阶段，API 可能发生变更。建议在生产环境使用前查看 [更新日志](https://github.com/kercylan98/vivid/releases) 了解最新变更。\n\n## 目录\n\n- [特性](#特性)\n- [系统要求](#系统要求)\n- [安装](#安装)\n- [架构概览](#架构概览)\n- [应用场景](#应用场景)\n- [文档](#文档)\n- [版本兼容性](#版本兼容性)\n- [安全](#安全)\n- [贡献](#贡献)\n- [许可证](#许可证)\n- [相关资源](#相关资源)\n\n## 特性\n\n- **完整的 Actor 模型实现**：提供 Actor 系统、Actor 上下文、Actor 引用等核心抽象\n- **灵活的消息传递**：支持 Tell（Fire-and-Forget）和 Ask（Request-Response）两种消息模式，以及消息管道（PipeTo）功能\n- **消息投递网络透明**：通过 ActorRef 发送消息，无论目标 Actor 在本地还是远程节点，都能自动路由，实现网络透明的消息投递\n- **远程通信支持**：内置 Remoting 功能，支持跨网络节点的 Actor 通信\n- **监督策略**：提供完善的错误处理和恢复机制，支持一对一（OneForOne）和一对多（OneForAll）监督策略，包括重启、停止、恢复、升级等决策\n- **调度功能**：内置调度器（Scheduler），支持定时（Once）、周期性（Loop）、Cron 表达式等多种调度方式\n- **消息暂存**：支持消息暂存（Stash）和恢复（Unstash）功能，适用于条件未满足时的消息缓冲场景\n- **行为栈管理**：支持 Actor 行为动态切换和恢复，实现状态机模式\n- **生命周期管理**：完整的 Actor 生命周期钩子（启动前、重启前、重启后等），支持监听其他 Actor 的终止事件（Watch/Unwatch）\n- **指标收集**：内置 Metrics 支持，可监控系统运行状态\n- **事件流**：提供事件流机制，支持系统级事件订阅和发布\n- **可扩展邮箱**：支持自定义邮箱实现，满足不同调度需求\n- **错误处理**：增强的错误类型，支持错误链和标准 error 处理\n- **类型安全**：充分利用 Go 的类型系统，提供类型安全的消息传递\n\n## 系统要求\n\n- **Go 版本**：1.25.1 或更高版本\n- **操作系统**：支持所有 Go 支持的操作系统（Linux、macOS、Windows 等）\n- **架构**：支持所有 Go 支持的 CPU 架构（amd64、arm64、386 等）\n\n## 安装\n\n使用 Go 模块管理工具安装：\n\n```bash\ngo get github.com/kercylan98/vivid\n```\n\n### 依赖说明\n\nVivid 的核心依赖保持最小化，主要包括：\n\n- `github.com/google/uuid` - UUID 生成\n- `github.com/reugn/go-quartz` - 调度器实现\n- `golang.org/x/sync` - 同步原语扩展\n- `github.com/stretchr/testify` - 测试工具（仅开发依赖）\n\n所有依赖均经过严格筛选，确保稳定性和安全性。\n\n## 应用场景\n\nVivid 适用于以下场景：\n\n- **分布式系统**：构建跨网络节点的分布式应用，利用网络透明的消息投递能力\n- **高并发服务**：处理大量并发请求，通过 Actor 模型实现线程安全的并发处理\n- **微服务架构**：作为微服务间通信的基础设施，提供可靠的异步消息传递\n- **状态机实现**：通过行为栈管理实现复杂的状态机模式\n- **事件驱动系统**：利用事件流机制构建松耦合的事件驱动架构\n- **定时任务调度**：使用内置调度器实现定时任务、周期性任务和 Cron 任务\n- **容错系统**：通过监督策略构建具有自动恢复能力的容错系统\n\n## 文档\n\n- **API 文档**：完整的 API 文档请访问 [pkg.go.dev](https://pkg.go.dev/github.com/kercylan98/vivid)\n- **Wiki 文档**：详细的使用指南和最佳实践请参考 [Wiki 站点](https://github.com/kercylan98/vivid/wiki)（建设中）\n- [更新日志](https://github.com/kercylan98/vivid/releases)\n\n## 许可证\n\n本项目采用 [MIT 许可证](LICENSE)。详情请参阅 [LICENSE](LICENSE) 文件。\n\n## 状态\n\n- **开发状态**：活跃开发中\n- **稳定性**：API 可能发生变更\n- **测试覆盖率**：持续提升中\n- **文档**：API 文档完整，Wiki 文档建设中\n\n## 版本兼容性\n\nVivid 从 **1.0.0** 版本开始遵循 [语义化版本控制](https://semver.org/lang/zh-CN/)：\n\n- **主版本号（MAJOR）**：不兼容的 API 变更\n- **次版本号（MINOR）**：向后兼容的功能新增\n- **修订号（PATCH）**：向后兼容的问题修复\n\n在 1.0.0 版本之前，项目处于活跃开发阶段，API 可能发生变更，不保证版本兼容性。建议在生产环境使用前仔细阅读更新日志。\n\n## 安全\n\n如果您发现安全漏洞，请通过以下方式报告：\n\n- **安全邮箱**：请通过 GitHub Security Advisories 报告安全问题\n- **公开问题**：对于非敏感问题，可直接创建 GitHub Issue\n\n我们会在收到报告后尽快响应并修复。\n\n## 贡献\n\n我们欢迎所有形式的贡献！在开始之前，请阅读以下指南：\n\n### 贡献流程\n\n1. Fork 本仓库\n2. 创建特性分支（`git checkout -b feature/amazing-feature`）\n3. 提交更改（`git commit -m 'Add some amazing feature'`）\n4. 推送到分支（`git push origin feature/amazing-feature`）\n5. 开启 Pull Request\n\n### 代码规范\n\n- 遵循 Go 官方代码规范\n- 确保所有测试通过（`go test ./...`）\n- 添加必要的测试用例和文档注释\n- 保持代码简洁和可读性\n\n### 提交规范\n\n提交信息应遵循 [Conventional Commits](https://www.conventionalcommits.org/) 规范：\n\n- `feat:` 新功能\n- `fix:` 问题修复\n- `docs:` 文档更新\n- `refactor:` 代码重构\n- `test:` 测试相关\n- `chore:` 构建/工具相关\n\n## 架构概览\n\n### Actor 系统架构\n\n```mermaid\ngraph TB\n    AS[ActorSystem] --\u003e |管理| AC1[Actor 1]\n    AS --\u003e |管理| AC2[Actor 2]\n    AS --\u003e |管理| AC3[Actor 3]\n    AC1 --\u003e |创建子 Actor| AC1_1[Child Actor 1-1]\n    AC1 --\u003e |创建子 Actor| AC1_2[Child Actor 1-2]\n    AC2 --\u003e |创建子 Actor| AC2_1[Child Actor 2-1]\n    \n    AS --\u003e |提供| ES[EventStream]\n    AS --\u003e |提供| SC[Scheduler]\n    AS --\u003e |提供| MC[Metrics]\n    AS --\u003e |可选| RS[Remoting Server]\n    \n    RS -.-\u003e |网络通信| RS2[Remote Node]\n    RS2 --\u003e |管理| RAC[Remote Actor]\n    \n    style AS fill:#e1f5ff\n    style RS fill:#fff4e1\n    style RS2 fill:#fff4e1\n```\n\n### 消息传递流程\n\n```mermaid\nsequenceDiagram\n    participant Sender as 发送者 Actor\n    participant Mailbox as 邮箱 (Mailbox)\n    participant Receiver as 接收者 Actor\n    participant Context as ActorContext\n    \n    Sender-\u003e\u003eMailbox: Tell/Ask 消息\n    Mailbox-\u003e\u003eContext: 分发消息\n    Context-\u003e\u003eReceiver: OnReceive(ctx)\n    Receiver-\u003e\u003eContext: 处理消息\n    Context-\u003e\u003eSender: Reply (可选，Ask 模式)\n```\n\n## 相关资源\n\n- [Actor 模型 (Wikipedia)](https://en.wikipedia.org/wiki/Actor_model) - Actor 模型的计算机科学理论\n- [Actor 模型论文](https://www.ijcai.org/Proceedings/73/Papers/027B.pdf) - Carl Hewitt 的原始论文","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkercylan98%2Fvivid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkercylan98%2Fvivid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkercylan98%2Fvivid/lists"}