template <class Request, class Response>
class ClientBidiReactor
Defined at line 232 of file ../../third_party/grpc-migrating/src/include/grpcpp/support/client_callback.h
is the interface for a bidirectional streaming RPC.
Public Methods
void StartCall ()
Activate the RPC and initiate any reads or writes that have been Start'ed
before this call. All streaming RPCs issued by the client MUST have
StartCall invoked on them (even if they are canceled) as this call is the
activation of their lifecycle.
Defined at line 238 of file ../../third_party/grpc-migrating/src/include/grpcpp/support/client_callback.h
void StartRead (Response * resp)
Initiate a read operation (or post it for later initiation if StartCall
has not yet been invoked).
Parameters
Defined at line 245 of file ../../third_party/grpc-migrating/src/include/grpcpp/support/client_callback.h
void StartWrite (const Request * req)
Initiate a write operation (or post it for later initiation if StartCall
has not yet been invoked).
Parameters
Defined at line 253 of file ../../third_party/grpc-migrating/src/include/grpcpp/support/client_callback.h
void StartWrite (const Request * req, grpc::WriteOptions options)
Initiate/post a write operation with specified options.
Parameters
Defined at line 261 of file ../../third_party/grpc-migrating/src/include/grpcpp/support/client_callback.h
void StartWriteLast (const Request * req, grpc::WriteOptions options)
Initiate/post a write operation with specified options and an indication
that this is the last write (like StartWrite and StartWritesDone, merged).
Note that calling this means that no more calls to StartWrite,
StartWriteLast, or StartWritesDone are allowed.
Parameters
Defined at line 274 of file ../../third_party/grpc-migrating/src/include/grpcpp/support/client_callback.h
void StartWritesDone ()
Indicate that the RPC will have no more write operations. This can only be
issued once for a given RPC. This is not required or allowed if
StartWriteLast is used since that already has the same implication.
Note that calling this means that no more calls to StartWrite,
StartWriteLast, or StartWritesDone are allowed.
Defined at line 283 of file ../../third_party/grpc-migrating/src/include/grpcpp/support/client_callback.h
void AddHold ()
Holds are needed if (and only if) this stream has operations that take
place on it after StartCall but from outside one of the reactions
(OnReadDone, etc). This is _not_ a common use of the streaming API.
Holds must be added before calling StartCall. If a stream still has a hold
in place, its resources will not be destroyed even if the status has
already come in from the wire and there are currently no active callbacks
outstanding. Similarly, the stream will not call OnDone if there are still
holds on it.
For example, if a StartRead or StartWrite operation is going to be
initiated from elsewhere in the application, the application should call
AddHold or AddMultipleHolds before StartCall. If there is going to be,
for example, a read-flow and a write-flow taking place outside the
reactions, then call AddMultipleHolds(2) before StartCall. When the
application knows that it won't issue any more read operations (such as
when a read comes back as not ok), it should issue a RemoveHold(). It
should also call RemoveHold() again after it does StartWriteLast or
StartWritesDone that indicates that there will be no more write ops.
The number of RemoveHold calls must match the total number of AddHold
calls plus the number of holds added by AddMultipleHolds.
The argument to AddMultipleHolds must be positive.
Defined at line 307 of file ../../third_party/grpc-migrating/src/include/grpcpp/support/client_callback.h
void AddMultipleHolds (int holds)
Defined at line 308 of file ../../third_party/grpc-migrating/src/include/grpcpp/support/client_callback.h
void RemoveHold ()
Defined at line 312 of file ../../third_party/grpc-migrating/src/include/grpcpp/support/client_callback.h
void OnDone (const grpc::Status & )
Notifies the application that all operations associated with this RPC
have completed and all Holds have been removed. OnDone provides the RPC
status outcome for both successful and failed RPCs and will be called in
all cases. If it is not called, it indicates an application-level problem
(like failure to remove a hold).
Parameters
Defined at line 321 of file ../../third_party/grpc-migrating/src/include/grpcpp/support/client_callback.h
void OnReadInitialMetadataDone (bool )
Notifies the application that a read of initial metadata from the
server is done. If the application chooses not to implement this method,
it can assume that the initial metadata has been read before the first
call of OnReadDone or OnDone.
Parameters
Defined at line 331 of file ../../third_party/grpc-migrating/src/include/grpcpp/support/client_callback.h
void OnReadDone (bool )
Notifies the application that a StartRead operation completed.
Parameters
Defined at line 337 of file ../../third_party/grpc-migrating/src/include/grpcpp/support/client_callback.h
void OnWriteDone (bool )
Notifies the application that a StartWrite or StartWriteLast operation
completed.
Parameters
Defined at line 344 of file ../../third_party/grpc-migrating/src/include/grpcpp/support/client_callback.h
void OnWritesDoneDone (bool )
Notifies the application that a StartWritesDone operation completed. Note
that this is only used on explicit StartWritesDone operations and not for
those that are implicitly invoked as part of a StartWriteLast.
Parameters
Defined at line 353 of file ../../third_party/grpc-migrating/src/include/grpcpp/support/client_callback.h