-
Notifications
You must be signed in to change notification settings - Fork 417
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
Convenience methods for Obligation and add_observer returning self #86
Conversation
if
I like very much a fluent interface, but in this case it will make code less flexible |
@mighe Thanks for reviewing. My thinking is: when o.add_observer(&(observer = -> { 'a' }))
o.delete_observer observer
# or with Proc auto-detection
o.add_observer(observer = -> { 'a' })
o.delete_observer observer I would allow |
I still don't like the We're talking about personal taste, so I'd like to hear the opinion from the other team members |
Ok lets wait :) For completeness' sake this was suggested in #73 (comment) to be able to write: actor.ask :something,
Ivar.new.add_observer { |time, value, reason| p time, value, reason } |
Just got an idea :) x.add_observer { 'a' } # => proc
x.with_observer { 'a' } # => x What do you think? For me this is a winner. Keeps the old behavior and adds what is needed for convenient observer adding. |
I've opened an Issue for tracking intermittently failing tests and I'm working through those as I find them. Please feel free to add to the list here when you experience these failures. |
@jdantonio thanks, this one is already there so I'll rerun this to get a green here. |
@mighe ack on |
Sorry 😊 |
👍 |
wait - waits and returns self no_error! - waits and raises on rejection, otherwise returns self value! - returns value, or raises if rejected exception - allows to call `raise rejected_ivar`
Thanks, doc added, merging after travis pass. |
Convenience methods for Obligation and add_observer returning self
No description provided.