簡體   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