繁体   English   中英

cosmos change feed processor的push model真的是下面的push model吗?

[英]Is push model of cosmos change feed processor really a push model underneath?

cosmos docs中提到

With a push model, the change feed processor pushes work to a client that has business logic for processing this work. However, the complexity in checking for work and storing state for the last processed work is handled within the change feed processor.

但是当我看到更改提要处理器库的生命周期时,它如下所示:


1. Read the change feed.
2. If there are no changes, sleep for a predefined amount of time (customizable with WithPollInterval in the Builder) and go to #1.
3. If there are changes, send them to the delegate.
4. When the delegate finishes processing the changes successfully, update the lease store with the latest processed point in time and go to #1.

看看这个生命周期,我们似乎是在轮询来自变更提要的变更,而不是它将变更推送给我们。

我的理解是否正确,一旦我当前的委托线程完成,下一组更改将从更改提要中提取? 是的,这怎么是推 model 而不是拉 model?

提前致谢。

它是将 model 推送到用户代码(更改被推送到委托,用户未轮询)但底层实现是轮询,流程如所述。

请记住,客户端库实际上只是与公开的服务端点(REST API)对话,没有特殊的推送协议(例如不是 gRPC),因此客户端只能执行正常的网络请求(发送请求,获取响应)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM