Comments (6)
可以参考 这个实现 https://github.com/asaskevich/EventBus
这个库非常精简,但是作者已经停止了维护。
from event.
具体点呢?要api更新那些东西
from event.
比如使用AsyncFire的实现是直接起一个go-routine去异步执行,但是这种方式导致服务热重启的时候感知不到这里有没有未执行完的任务。建议event对外提供一个WatiGroup可以允许外部热重启的地方执行wait操作。
from event.
就是要实现一个服务计数器对吧?请求来的时候+1,请求完成-1,请求计数0的时候才允许热重启。
from event.
你可以用 waitgroup去实现。
from event.
@xiaofeige @a67793581 v1.1.0+
版本已经添加了简单的实现。
可以使用 Async/FireC/FireAsync
方法触发事件,事件将会写入 chan 异步消费。可以使用 CloseWait()
关闭chan并等待事件全部消费完成。
from event.
Related Issues (20)
- 支持根据事件名称前缀 PREFIX.* 来进行一组事件监听 这个使用有BUG
- Any more examples on how to use some of the capabilities? HOT 2
- Possible to add Event Timer Triggers? HOT 7
- Channels on Fire func HOT 3
- functionality Wildcard HOT 2
- How to register a subscriber ? HOT 2
- 见图片,并发下数据会有问题 HOT 1
- 使用自定义事件,并发会有问题 HOT 4
- 如何自定义event,我看用的是默认的全局,可否拆出来使用? HOT 2
- 这个是不支持在事件中去触发另一个事件的吗 HOT 1
- 这个触发异步事件有具体的写法 贴一下吗 HOT 2
- I'm here again,V1.1.1 has goroutine leak.please see this eg. HOT 4
- 如何比较好的处理 HOT 1
- goroutine并发添加event时候提示fatal error: concurrent map writes HOT 4
- 异步多线程消费 HOT 1
- matchNodePath是否可以支持自定义分隔符
- 建议 Event Name 检查出错后返回 error,而不是直接 panic
- 异步事件,不执行
- Custom events failed to execute HOT 1
- How to unregisterListener ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from event.