-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat:add Bidistreaming Api #890
Conversation
Hi @HHoflittlefish777, welcome to SOFAStack community, Please sign Contributor License Agreement! After you signed CLA, we will automatically sync the status of this pull request in 3 minutes. |
@Override | ||
public StreamObserver<Message> invokeBidiStreaming(Endpoint endpoint, Object request, InvokeContext ctx, | ||
InvokeCallback callback, long timeoutMs) { | ||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以 throw 一个 UnsupportedException 之类的 error
@@ -119,6 +122,12 @@ public void invokeAsync(final Endpoint endpoint, final Object request, final Inv | |||
} | |||
} | |||
|
|||
@Override | |||
public StreamObserver<Message> invokeBidiStreaming(Endpoint endpoint, Object request, InvokeContext ctx, | |||
InvokeCallback callback, long timeoutMs) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议参考原有代码规范,添加 final 关键字
future.cancel(true); | ||
throw new RemotingException(t); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个格式需要手动复原一下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个格式是由mvn clean compile格式化的,需要复原吗?
// NO-OP | ||
} | ||
}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
上面的代码需要手动复原格式
<artifactId>grpc-stub</artifactId> | ||
<version>1.17.0</version> | ||
<scope>compile</scope> | ||
</dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为什么 jraft-core 需要依赖 grpc? 应该是 rpc_grpc-impl 依赖吧?
* | ||
* @author HH | ||
*/ | ||
public class UnSupportException extends Exception{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @return request stream observer. | ||
*/ | ||
default StreamObserver<Message> invokeBidiStreaming(final Endpoint endpoint, final Object request, final InvokeCallback callback, | ||
final long timeoutMs) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这一行好像格式没对齐
catch (final UnSupportException e) { | ||
e.printStackTrace(); | ||
} | ||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
需要抛出异常,不能吞掉
代码质量未达预期,先关闭了 |
Motivation:
Explain the context, and why you're making that change.
To make others understand what is the problem you're trying to solve.
Modification:
Describe the idea and modifications you've done.
Result:
Fixes
If there is no issue then describe the changes introduced by this PR.