Problem: Async::LimitedQueue#<< does not block when the queue is full.
Explanation: both alias and alias_method despite their misleading names do not create aliases, they create full copies of methods with new names. Therefore if one overrides aliased method in a subclass, the alias name still points to the copy of the original base class method. There are 2 ways of dealing with it:
Description
Replace
alias
withdef_delegator
inQueue
.Problem:
Async::LimitedQueue#<<
does not block when the queue is full.Explanation: both
alias
andalias_method
despite their misleading names do not create aliases, they create full copies of methods with new names. Therefore if one overrides aliased method in a subclass, the alias name still points to the copy of the original base class method. There are 2 ways of dealing with it:def new_name(*args, **params) = old_name(*args, **params)
Forwardable.def_delegator
Check out a gist and a blog post
I'd also recommend replacing aliases everywhere where a class with aliases may potentially be inherited.
Thank you!
Types of Changes
Testing