# README
模块封装
在服务有多个模块,且需要相互通信时,提供了一种通用的封装方式。
其实类似spring的生命周期管理,一般情况下每个模块需要初始化、运行和关闭的生命周期,且模块之间可能有启动顺序依赖。
此外,各模块之间需要相互调用,这个调用可能是同步的,也可能是异步的。受leaf框架启发,这里抽象了模块的概念。
具体用法请参考example文件夹里面的例子。
# Functions
No description provided by the author
NewCronExpr 类似cron的单机定时器,goroutine safe.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
CallbackChn 是回调函数的队列包装.
No description provided by the author
CronExpr 类似linux cron的表达式Field name | Mandatory? | Allowed values | Allowed special characters ---------- | ---------- | -------------- | -------------------------- Seconds | No | 0-59 | * / , - Minutes | Yes | 0-59 | * / , - Hours | Yes | 0-23 | * / , - Day of month | Yes | 1-31 | * / , - Month | Yes | 1-12 | * / , - Day of week | Yes | 0-6 | * / , -.
Dispatcher one per goroutine (goroutine not safe).
GoroutineMixIn 是一个封装后的独立协程 在原本协程的基础上增加了协程间通信等功能.
LinearCallbackChn 包括一个待执行函数和执行完毕之后回调的函数.
No description provided by the author
No description provided by the author
RpcServer one rpcServer per goroutine (goroutine not safe) one rpcClient per goroutine (goroutine not safe).
Timer 定时器.
# Interfaces
Module 是抽象的运行模块.