File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -14,13 +14,30 @@ pub struct FlowInstanceContext {
1414 pub flow_instance_name : String ,
1515}
1616
17+ pub struct SourceData < ' a > {
18+ pub update_time : Option < chrono:: DateTime < chrono:: Utc > > ,
19+ pub data : BoxFuture < ' a , Result < FieldValues > > ,
20+ }
21+
22+ pub struct SourceChange < ' a > {
23+ /// Last update/deletion time. None means unavailable.
24+ pub time : Option < chrono:: DateTime < chrono:: Utc > > ,
25+ /// None means a deletion.
26+ pub data : Option < BoxFuture < ' a , Result < FieldValues > > > ,
27+ }
28+
1729#[ async_trait]
1830pub trait SourceExecutor : Send + Sync {
1931 /// Get the list of keys for the source.
2032 async fn list_keys ( & self ) -> Result < Vec < KeyValue > > ;
2133
2234 // Get the value for the given key.
23- async fn get_value ( & self , key : & KeyValue ) -> Result < Option < FieldValues > > ;
35+ async fn get_value (
36+ & self ,
37+ key : & ' async_trait KeyValue ,
38+ ) -> Result < Option < SourceData < ' async_trait > > > ;
39+
40+ async fn get_changes ( & self ) -> Result < Vec < SourceChange < ' async_trait > > > ;
2441}
2542
2643pub trait SourceFactory {
You can’t perform that action at this time.
0 commit comments