Send feedback
EventController
Stay organized with collections
Save and categorize content based on your preferences.
protocol EventController : Sendable
Controller for subscribing to events from a particular object.
Returns whether the given event type is supported by this controller.
Declaration
Swift
func contains < E > ( _ type : E . Type ) -> Bool where E : Event
Subscribes to events of a given type E
.
Declaration
Swift
func subscribe < E > ( _ type : E . Type ) -> AnyPublisher < E , HomeError > where E : Event
Return Value
A Publisher
that will publish events of the given type E
.
Subscribes to all event types supported by the trait of a given type T
.
Return Value
A Publisher
that will publish the events.
Helper wrapper around subscribe(_:)
that accepts a variabic parameter.
Return Value
A Publisher
that will publish the events.
Subscribes to all event types supported by the given traits.
Return Value
A Publisher
that will publish the events.
Subscribes to all event types on all traits supported by the given device (if any).
Note that the published events are of type AnyEvent
and will need to be manually decoded
into the appropriate concrete event type (as determined by the client) in order to be used.
Return Value
A Publisher
that will publish events from the device (if any).
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-04-09 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Incorrect information","incorrectInformation","thumb-down"],["Not enough information/samples","notEnoughInformationSamples","thumb-down"],["Too complicated","tooComplicated","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-04-09 UTC."],[],[]]