简体   繁体   English

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

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

It is mentioned in cosmos docs that 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.

But when I see the lifecycle of change feed processor library, it is as follows-:但是当我看到更改提要处理器库的生命周期时,它如下所示:


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.

Looking at this lifecycle, it seems like we are polling changes from change feed instead of it pushing changes to us.看看这个生命周期,我们似乎是在轮询来自变更提要的变更,而不是它将变更推送给我们。

Is my understanding correct that the next set of changes will be pulled from change feed once my current delegate thread has finished or not?我的理解是否正确,一旦我当前的委托线程完成,下一组更改将从更改提要中提取? Is yes, how is this a push model and not a pull model?是的,这怎么是推 model 而不是拉 model?

Thanks in advance.提前致谢。

It is a push model to the user code (changes are pushed to the delegate, the user is not polling) but the underneath implementation is a poll and the flow is as described.它是将 model 推送到用户代码(更改被推送到委托,用户未轮询)但底层实现是轮询,流程如所述。

Remember the client library really just talks with the exposed service endpoints (REST APIs), there is no special push protocol (not gRPC for example), so clients can only do normal.network requests (send request, get response).请记住,客户端库实际上只是与公开的服务端点(REST API)对话,没有特殊的推送协议(例如不是 gRPC),因此客户端只能执行正常的网络请求(发送请求,获取响应)。

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

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