template <class Data>
class HangingGetHelper
Defined at line 110 of file ../../src/ui/scenic/lib/flatland/hanging_get_helper.h
A helper class for managing [hanging get
semantics](https://fuchsia.dev/fuchsia-src/development/api/fidl.md#delay-responses-using-hanging-gets).
It responds with the most recently updated value.
For each hanging get method in a FIDL interface, like GetData() -> ( Data response ), create one
of these classes. Any time the response should change, call Update(Data x). Any time the client
calls GetFoo(), set the callback on this helper. Once the callback has been set and the data has
been updated, the callback will be triggered with the new data.
Each callback will only be triggered once. Each Update will only trigger, at most, a single
callback. Update(Data x) is idempotent. Calling it with the same value will not trigger a new
execution of a registered callback, nor will it remove the registered callback.
Public Methods
void HangingGetHelper<Data> ()
Defined at line 114 of file ../../src/ui/scenic/lib/flatland/hanging_get_helper.h
void Update (Data data)
Defined at line 116 of file ../../src/ui/scenic/lib/flatland/hanging_get_helper.h
void SetCallback (Callback callback)
Defined at line 127 of file ../../src/ui/scenic/lib/flatland/hanging_get_helper.h
bool HasPendingCallback ()
Defined at line 134 of file ../../src/ui/scenic/lib/flatland/hanging_get_helper.h