blob: babc0867e391b305aca93832f31fe13ec2f136c1 [file] [log] [blame] [view]
To do so, this tutorial implements the `EchoLauncher` protocol from the
[fuchsia.examples library](/examples/fidl/fuchsia.examples/):
```fidl
{%includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="examples/fidl/fuchsia.examples/echo.test.fidl" region_tag="launcher" %}
```
This is a protocol that lets clients retrieve an instance of the `Echo`
protocol. Clients can specify a prefix, and the resulting `Echo` instance
adds that prefix to every response.
There are two methods that can be used to accomplish this:
* `GetEcho`: Takes the prefix as a request, and responds with the client end of
a channel connected to an implementation of the `Echo` protocol. After
receiving the client end in the response, the client can start making requests
on the `Echo` protocol using the client end.
* `GetEchoPipelined`: Takes the server end of a channel as one of the request
parameters and binds an implementation of `Echo` to it. The client that
made the request is assumed to already hold the client end, and will
start making `Echo` requests on that channel after calling `GetEchoPipeliend`.
As the name suggests, the latter uses a pattern called protocol request
pipelining, and is the preferred approach. This tutorial implements both
approaches.