caosdb/file_transmission/upload_request_handler.h

namespace caosdb::transaction

Creation and execution of transactions.

Author

Timm Fitschen

Date

2021-08-05

class UploadRequestHandler : public caosdb::transaction::HandlerInterface

Public Functions

UploadRequestHandler(HandlerTag tag, FileTransmissionService::Stub *stub, grpc::CompletionQueue *cq, FileDescriptor file_descriptor)
~UploadRequestHandler() override = default
UploadRequestHandler(const UploadRequestHandler&) = delete
UploadRequestHandler &operator=(const UploadRequestHandler&) = delete
UploadRequestHandler(UploadRequestHandler&&) = delete
UploadRequestHandler &operator=(UploadRequestHandler&&) = delete
inline virtual void Start() override
virtual bool OnNext(bool ok) override
virtual void Cancel() override

Protected Types

enum CallState

Values:

enumerator NewCall
enumerator SendingHeader
enumerator SendingFile
enumerator ExpectingResponse
enumerator CallComplete

Protected Functions

void handleNewCallState()
void handleSendingHeaderState()
void handleSendingFileState()
void handleExpectingResponseState()
void handleCallCompleteState()

Protected Attributes

HandlerTag tag_
FileTransmissionService::Stub *stub_
grpc::CompletionQueue *cq_
grpc::ClientContext ctx_
std::unique_ptr<grpc::ClientAsyncWriter<FileUploadRequest>> rpc_
FileUploadRequest *request_
FileUploadResponse *response_
grpc::Status status_
CallState state_
std::unique_ptr<FileReader> fileReader_
FileDescriptor file_descriptor_
uint64_t bytesToSend_