-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e15ed85
commit 6d3caf1
Showing
1 changed file
with
16 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package rpc | ||
|
||
type ( | ||
// NonBlockingCaller 非阻塞 RPC 调用器,用于在不关心调用结果的情况下进行异步调用 | ||
// - 该调用器不一定能够成功执行 | ||
NonBlockingCaller func(param any) error | ||
|
||
// BlockingCaller 阻塞 RPC 调用器,用于在不关心调用结果的情况下进行同步调用,除了与 NonBlockingCaller 的区别外,该函数可以保证调用成功 | ||
BlockingCaller func(param any) error | ||
|
||
// NonBlockingRequestCaller 非阻塞 RPC 请求调用器,该调用器会在调用成功后将结果通过 Reader 返回到回调函数中 | ||
NonBlockingRequestCaller func(param any, callback func(reader Reader)) error | ||
|
||
// BlockingRequestCaller 阻塞 RPC 请求调用器,该调用器会在调用成功后将结果通过 Reader 返回到调用方 | ||
BlockingRequestCaller func(param any) (Reader, error) | ||
) |