-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an API on MTRDevice to wait for attributes to reach certain values. #36205
base: master
Are you sure you want to change the base?
Add an API on MTRDevice to wait for attributes to reach certain values. #36205
Conversation
PR #36205: Size comparison from e36bde7 to 2d750d1 Full report (68 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
2d750d1
to
37d549d
Compare
PR #36205: Size comparison from b3223b6 to 37d549d Full report (68 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
37d549d
to
cd8e3a9
Compare
Various changes happened since the review
PR #36205: Size comparison from 62a4a97 to cd8e3a9 Full report (68 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
PR #36205: Size comparison from 62a4a97 to 3b360e5 Increases above 0.2%:
Full report (67 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
*/ | ||
- (void)cancel; | ||
|
||
@property (readonly, nonatomic) NSUUID * waiterID; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@property (readonly, nonatomic) NSUUID * waiterID; | |
@property (readonly, nonatomic) NSUUID * UUID; |
* Nil will be returned if for some reason the wait could not be started | ||
* (e.g. invalid input). | ||
*/ | ||
- (MTRAttributeValueWaiter * _Nullable)waitForAttributeValues:(NSDictionary<MTRAttributePath *, NSDictionary<NSString *, id> *> *)values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is nullable, then it needs to return an NSError ** out param.
Per our discussion as well, I feel this is mixing two worlds together... I prefer delegate, but not a hill i'll die on :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I talked about the delegate idea to some folks, and it has a drawback, which is that it makes it hard to take different actions depending on which set of attributes you were waiting for; you sort of have to define a new protocol implementation for each new thing you decide you might need, and if you need to change the behavior at runtime at all you end up having to do blocks for the behavior anyway, but now held by the delegate. So just in terms of how people want to use this API it does not feel like a great fit.
Good point about NSError**; if this stays nullable (as opposed to switching to "just assert on bad input"), I will do that.
No description provided.