[Nitro] OG [PATCH RFC]: Separate Og.start options hash from Og.manager_options

Mark Van De Vyver mvyver at gmail.com
Mon Oct 8 06:32:18 EDT 2007


On 9/13/07, Mark Van De Vyver <mvyver at gmail.com> wrote:
> Hi
> On 9/13/07, George Moschovitis <george.moschovitis at gmail.com> wrote:
> > Seems logical. I am applying the patch. However a better solution is needed
> > (that will properly handle multiple Og stores at the same time, for db
> > partitioning/sharding, etc)
>
> I agree.  My understanding is that each manger looks after only one
> store, but there are multiple managers that are tracked.
> I have a solution in mind - that should be backwards compatible, and
> handle multiple stores, of different types, and possibly stores of one
> type with multiple adapters.
>
> I'm beginning to form the view that the manager's options should be
> separated from (i.e. not sync'd with) the store's options, and both
> should at least be attr_readable.
>
> Anyone have a case for making them, that is `manger.options` and
> `store.options`, attr_accessor?
>
> > We will get back to this at a later time.
>
> OK.  But I'm working on an adapter's spec's now, so I'll post anything
> I come up with while it is fresh in my  mind.
>

I'm considering introducing some optional settings that at the moment
are specific to the DBI adapter (but needn't be)
Question:
1) Is it the case that _any_ setting that can be passed as an option
to Og.start(options), should have it's default specified and
documented using (example):
setting(:name {:default =>true, :doc=>"doc"})
in the Og module file ./lib/og/og.rb?

I ask because there is the following comment in og.rb:
  #--
  # TODO: move this to the sql store.
  #++
which made me wonder if these setting calls should be placed there or
elsewhere, even if they can be passed to Og.start(options).... ?

Mark


> Cheers
> Mark
>
> >
> > thank you,
> > George.
> >
> >
> > On 9/13/07, Mark Van De Vyver <mvyver at gmail.com> wrote:
> > >
> > > Hi Devs,
> > >
> > > Spec's helped indicate something was wrong but it still took much time
> > > to work out what - esp given I was working on an adapter spec and this
> > > is in the og.rb file.... :)
> > >
> > > Separate Og start options hash from Og.manager_options - consecutive
> > > starts no longer pollute Og.manager_options
> > >
> > > The attached patch attempts to isolate the options hash that og
> > > receives on start, and any changes made to it, from the defaults
> > > stored in Og.manager_options.
> > >
> > > Reason, consider the following sequence (pre-patch):
> > >
> > > Og.start # Starts with Og default options - EXPECTED
> > > Og.manager.close_store
> > > Og.manager.unmanage_classes
> > >
> > > Og.start ({<custom_hash>}) # Starts with custom options - EXPECTED
> > > Og.manager.close_store
> > > Og.manager.unmanage_classes
> > >
> > > Og.start # Starts with custom options - UNEXPECTED
> > > Og.manager.close_store
> > > Og.manager.unmanage_classes
> > >
> > > Instead I believe the startup behavior should be (post-patch):
> > >
> > > Og.start # Starts with Og default options - EXPECTED
> > > Og.manager.close_store
> > > Og.manager.unmanage_classes
> > >
> > > Og.start({<custom_hash>}) # Starts with custom options - EXPECTED
> > > Og.manager.close_store
> > > Og.manager.unmanage_classes
> > >
> > > Og.start # Starts with Og default options - EXPECTED
> > > Og.manager.close_store
> > > Og.manager.unmanage_classes
> > >
> > > The way to change default startup behavior would be (post-patch):
> > >
> > > Og.manger_options={}.update({<custom_hash>})
> > > Og.start #starts with custom options - EXPECTED
> > > Og.manager.close_store
> > > Og.manager.unmanage_classes
> > >
> > > _______________________________________________
> > > Nitro-general mailing list
> > > Nitro-general at rubyforge.org
> > > http://rubyforge.org/mailman/listinfo/nitro-general
> > >
> > >
> >
> >
> >
> > --
> > http://www.me.gr
> > http://phidz.com
> > http://blog.gmosx.com
> > http://cull.gr
> > http://www.joy.gr
> > http://nitroproject.org
>


More information about the Nitro-general mailing list