Francis Cianfrocca
2007-Nov-02 00:10 UTC
[Eventmachine-talk] For Tony Arcieri, on EM::Connection#post_init
Tony, the mods you checked in pass all the standard tests, but I hit a regression with my REST framework. It assumes that #post_init will be called inside of the EM::Connection base class initializer. I had something like this: class Something < EM::Connection def initialize *args super p @my_ivar end def post_init @my_ivar = :something end end It was actually a lot more complex because the #post_init was written in C (it was in an extension) but the point is the same. With your new code, this example will give an error. I''m not terribly concerned about this regression because I suspect it won''t affect too much code, but we should be clear on whether the documented behavior has changed. Can you give a concise description of how #initialize and #post_init interact, including the role of the newly-supported parameters, so we can publish it and know what to expect? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/eventmachine-talk/attachments/20071102/e8698211/attachment.html
#post_init is now being called within EM::Connection.new It''s occurring after both allocate and initialize, but before EM:: Connection.new returns a new instance of an EM::Connection object. #initialize is effectively a stub in the base class now. That way calling super is optional (and a noop) Because of that, #post_init will always be called only after #initialize returns On 11/2/07, Francis Cianfrocca <garbagecat10 at gmail.com> wrote:> > Tony, the mods you checked in pass all the standard tests, but I hit a > regression with my REST framework. It assumes that #post_init will be called > inside of the EM::Connection base class initializer. I had something like > this: > > class Something < EM::Connection > def initialize *args > super > p @my_ivar > end > > def post_init > @my_ivar = :something > end > > end > > > It was actually a lot more complex because the #post_init was written in C > (it was in an extension) but the point is the same. With your new code, this > example will give an error. > > I''m not terribly concerned about this regression because I suspect it > won''t affect too much code, but we should be clear on whether the documented > behavior has changed. > > Can you give a concise description of how #initialize and #post_init > interact, including the role of the newly-supported parameters, so we can > publish it and know what to expect? Thanks. > > _______________________________________________ > Eventmachine-talk mailing list > Eventmachine-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/eventmachine-talk >-- Tony Arcieri ClickCaster, Inc. tony at clickcaster.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/eventmachine-talk/attachments/20071102/0416b6c7/attachment-0001.html
Andre Nathan
2007-Nov-02 10:42 UTC
[Eventmachine-talk] REST framework (was For Tony Arcieri,
On Fri, 2007-11-02 at 03:10 -0400, Francis Cianfrocca wrote:> Tony, the mods you checked in pass all the standard tests, > but I hit a regression with my REST framework.Hi Francis Sorry to hijack the thread... Is this REST framework something you have released or intend to release? Building a REST API server was the reason I started investigating eventmachine, so if this code is publicly available, I''d like to have a look at it :) Best, Andre
Francis Cianfrocca
2007-Nov-02 17:21 UTC
[Eventmachine-talk] REST framework (was For Tony Arcieri,
On 11/2/07, Andre Nathan <andre at digirati.com.br> wrote:> > On Fri, 2007-11-02 at 03:10 -0400, Francis Cianfrocca wrote: > > Tony, the mods you checked in pass all the standard tests, > > but I hit a regression with my REST framework. > > Hi Francis > > Sorry to hijack the thread... Is this REST framework something you have > released or intend to release? Building a REST API server was the reason > I started investigating eventmachine, so if this code is publicly > available, I''d like to have a look at it :)I''ll try to get it released over the weekend. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/eventmachine-talk/attachments/20071102/49d6e7ff/attachment.html