WBWatcher的定义增加了forUpdate选项
This commit is contained in:
parent
c8847db748
commit
c49fbc8f0f
|
|
@ -17,6 +17,7 @@ export interface WBWatcher<ED extends EntityDict & BaseEntityDict, T extends key
|
|||
filter: ED[T]['Selection']['filter'] | (() => Promise<ED[T]['Selection']['filter']>);
|
||||
projection: ED[T]['Selection']['data'] | (() => Promise<ED[T]['Selection']['data']>);
|
||||
fn: (context: Cxt, data: Partial<ED[T]['Schema']>[]) => Promise<OperationResult<ED>>;
|
||||
forUpdate?: true;
|
||||
singleton?: true;
|
||||
}
|
||||
export type Watcher<ED extends EntityDict & BaseEntityDict, T extends keyof ED, Cxt extends AsyncContext<ED>> = BBWatcher<ED, T> | WBWatcher<ED, T, Cxt>;
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ export interface WBWatcher<ED extends EntityDict & BaseEntityDict, T extends key
|
|||
filter: ED[T]['Selection']['filter'] | (() => Promise<ED[T]['Selection']['filter']>);
|
||||
projection: ED[T]['Selection']['data'] | (() => Promise<ED[T]['Selection']['data']>);
|
||||
fn: (context: Cxt, data: Partial<ED[T]['Schema']>[]) => Promise<OperationResult<ED>>;
|
||||
forUpdate?: true;
|
||||
singleton?: true; // 置singleton意味着在集群环境中只有一个进程会去执行
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue