Skip to content

Asynchronous Callback API Tutorial #1407

@ortwinrose

Description

@ortwinrose

Section Server-side streaming RPC, Server, description of ListFeatures implementation: The description of activities performed in ListFeatures constructor is wrong. It describes collecting features into features_to_send_, which does not exist in code. In the same manner, the next paragraph describing OnWriteDone() is wrong: "we continue to send the next Feature until features_to_send_ is empty".
Instead the description should be like this:
The ServerWriteReactor's constructor is called when ListFeatures() constructs and provides the reactor in response to the started RPC. It obtains a pointer to the global feature_list_, and starts sending features through a call to NextWrite(). This method scans the list of features for a matching entry, and starts its transmission through a call to StartWrite().
OnWriteDone() reacts to write completion. If the write was done successfully, we continue to send the next feature through a call to NextWrite(). When the whole collection of features is scanned (i.e. all relevant features have been sent), the NextWrite() method calls Finish(Status::OK) to finish the RPC.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions