Skip to content
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

Closed
wants to merge 5 commits into from
Closed

Conversation

sollhui
Copy link

@sollhui sollhui commented Oct 11, 2022

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.

@sofastack-bot
Copy link

sofastack-bot bot commented Oct 11, 2022

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.

@sofastack-bot sofastack-bot bot added size/XL and removed size/XXL labels Oct 11, 2022
@Override
public StreamObserver<Message> invokeBidiStreaming(Endpoint endpoint, Object request, InvokeContext ctx,
InvokeCallback callback, long timeoutMs) {
return null;
Copy link
Contributor

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) {
Copy link
Contributor

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);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个格式需要手动复原一下

Copy link
Author

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
}
});
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

上面的代码需要手动复原格式

@sofastack-bot sofastack-bot bot added size/L and removed size/XL labels Oct 13, 2022
<artifactId>grpc-stub</artifactId>
<version>1.17.0</version>
<scope>compile</scope>
</dependency>
Copy link
Contributor

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{
Copy link
Contributor

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) {
Copy link
Contributor

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要抛出异常,不能吞掉

@fengjiachun
Copy link
Contributor

代码质量未达预期,先关闭了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants