-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow erlmld_worker:ready/1 callback to checkpoint (#16)
* allow `erlmld_worker:ready/1` callback to checkpoint * new `erlmld_flusher:heartbeat/1` callback
- Loading branch information
Showing
4 changed files
with
50 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,18 @@ | |
%%% The batch processor handles checkpointing and decides when to trigger | ||
%%% flushing. | ||
%%% | ||
%%% heartbeat/1 will be called regardless of whether any records could be | ||
%%% obtained from the stream. It may return the same values as flush/2. | ||
%%% If it returns a non-empty list of tokens as the third tuple element, it | ||
%%% is considered to have just performed a partial flush. This allows a | ||
%%% flusher to flush even if no records were actually available on the | ||
%%% stream (e.g., after a period of time has elapsed), avoiding potential | ||
%%% near-deadlock situations which would only be resolved by additional | ||
%%% stream records appearing (where the batch processor is waiting for | ||
%%% tokens from the flusher before checkpointing, but the flusher is | ||
%%% waiting for more records from the batch processor before producing | ||
%%% tokens via flushing). | ||
%%% | ||
%%% @end | ||
%%% Created : 20 Dec 2016 by Constantin Berzan <[email protected]> | ||
|
||
|
@@ -47,3 +59,7 @@ | |
-callback flush(flusher_state(), partial | full) -> | ||
{ok, flusher_state(), list(flusher_token())} | ||
| {error, term()}. | ||
|
||
-callback heartbeat(flusher_state()) -> | ||
{ok, flusher_state(), list(flusher_token())} | ||
| {error, term()}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters