class Bus

Defined at line 1138 of file fidling/gen/src/connectivity/network/testing/netemul/sync-manager/fidl/sync/hlcpp/fuchsia/netemul/sync/cpp/fidl.h

Represents a named bus:

a bus is a broadcast pub/sub network that distributes Events.

Events are not stored, only forwarded to attached clients.

Public Methods

void ~Bus ()
void Publish (::fuchsia::netemul::sync::Event data)

Publishes event on the bus.

void EnsurePublish (::fuchsia::netemul::sync::Event data, EnsurePublishCallback callback)

Publishes data on bus and only returns when data has been dispatched.

Use this if you need guarantees that the data was broadcast before continuing.

Note that this ensures that the data will be *published* to all listening clients,

but it cannot guarantee that all clients will have observed the event before it returns.

void GetClients (GetClientsCallback callback)

Get list of named clients.

void WaitForClients (::std::vector< ::std::string> clients, int64_t timeout, WaitForClientsCallback callback)

Waits for up to `timeout` (nsec) for all the clients in `clients`.

Returns true if all clients are present on the bus before timeout expired.

If `result` is false, `absent` will contain the entries in `clients` that still weren't

present on the bus when the timout expired.

Use `timeout`

<

= 0 for indefinite wait.

void WaitForEvent (::fuchsia::netemul::sync::Event data, int64_t timeout, WaitForEventCallback callback)

Waits for up to `timeout` (nsec) for an event that matches `data`.

Event equality is performed by comparing *all* set fields in `data`.

Returns true if event was received before timeout expired.

Use `timeout`

<

= 0 for indefinite wait.