The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Reloading Dependencies

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Jamis Buck

Posts: 184
Nickname: minam
Registered: Oct, 2004

Jamis Buck is a C/Java software developer for BYU, and hacks in Ruby for fun.
Reloading Dependencies Posted: Oct 10, 2004 5:33 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Jamis Buck.
Original Post: Reloading Dependencies
Feed Title: the buckblogs here
Feed URL: http://weblog.jamisbuck.org/blog.cgi/programming/index.rss
Feed Description: Jamis Buck's corner of the blogging universe. Mostly about ruby, but includes ramblings on a variety of topics.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Jamis Buck
Latest Posts From the buckblogs here

Advertisement

Leon Breedt recently proposed a way to allow services to be refreshed automatically when their dependencies are altered, in Syringe (ruby-talk:116021, among others). Although I don’t think his proposed solution isn’t generally possible in Syringe, it did inspire me with another idea.

My response to his post (ruby-talk:116040) described a new service model, whimsically termed RefreshableServiceModel, that would allow services to be registered and manually identified as observers on other services. It wraps its services in a kind of deferring proxy. When the observed services emit an explicit “refresh!” signal, the observers then reload themselves and cause their wrapped services to be reinstantiated.

To properly support what Leon mentioned, this would require that upon recieving a “refresh!” notification, each service should also emit its own “refresh!” notification, after reloading itself. This will propogate the refresh all the way through the dependency graph. However, since cycles in the graph are possible, this means that some way of detecting the cycles and preventing an infinite loop would be necessary, too.

I haven’t tried implementing it yet, so I don’t know if it will work, but I’m tempted… I’m still a little doubtful about how generally useful this would be, though.

Read: Reloading Dependencies

Topic: That's not going to happen Previous Topic   Next Topic Topic: Rubyist Magazine 0001

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use