mirror of https://github.com/grpc/grpc-java.git
Remove fluent-style from newtransport Stream.
The fluent-style wasn't being used, yet made it impossible to simultaneously implement both ClientStream and ServerStream. Having a single class that switches between client and server behavior based on a boolean is helpful to some transports. ------------- Created by MOE: http://code.google.com/p/moe-java MOE_MIGRATED_REVID=69028356
This commit is contained in:
parent
5e01cea1ef
commit
4fd4845481
|
@ -4,7 +4,7 @@ package com.google.net.stubby.newtransport;
|
|||
/**
|
||||
* Extension of {@link Stream} to support client-side termination semantics.
|
||||
*/
|
||||
public interface ClientStream extends Stream<ClientStream> {
|
||||
public interface ClientStream extends Stream {
|
||||
|
||||
/**
|
||||
* Used to abnormally terminate the stream. Any internally buffered messages are dropped. After
|
||||
|
|
|
@ -6,7 +6,7 @@ import com.google.net.stubby.Status;
|
|||
/**
|
||||
* Extension of {@link Stream} to support server-side termination semantics.
|
||||
*/
|
||||
public interface ServerStream extends Stream<ServerStream> {
|
||||
public interface ServerStream extends Stream {
|
||||
|
||||
/**
|
||||
* Closes the local side of this stream. A status code of
|
||||
|
|
|
@ -7,7 +7,7 @@ import javax.annotation.Nullable;
|
|||
/**
|
||||
* A single stream of communication between two end-points within a transport.
|
||||
*/
|
||||
public interface Stream<T extends Stream<T>> {
|
||||
public interface Stream {
|
||||
|
||||
/**
|
||||
* Gets the current state of this stream.
|
||||
|
@ -39,7 +39,7 @@ public interface Stream<T extends Stream<T>> {
|
|||
* @param accepted an optional callback for when the transport has accepted the write.
|
||||
* @return this stream instance.
|
||||
*/
|
||||
T writeContext(String name, InputStream value, int length, @Nullable Runnable accepted);
|
||||
void writeContext(String name, InputStream value, int length, @Nullable Runnable accepted);
|
||||
|
||||
/**
|
||||
* Writes a message payload to the remote end-point. The bytes from the stream are immediate read
|
||||
|
@ -58,10 +58,10 @@ public interface Stream<T extends Stream<T>> {
|
|||
* @param accepted an optional callback for when the transport has accepted the write.
|
||||
* @return this stream instance.
|
||||
*/
|
||||
T writeMessage(InputStream message, int length, @Nullable Runnable accepted);
|
||||
void writeMessage(InputStream message, int length, @Nullable Runnable accepted);
|
||||
|
||||
/**
|
||||
* Flushes any internally buffered messages to the remote end-point.
|
||||
*/
|
||||
T flush();
|
||||
void flush();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue