Re: Improving API for lists, or wildcarded schemas



In <1075405273 4474 47 camel localhost localdomain>, Havoc Pennington wrote:

> On Thu, 2004-01-29 at 08:59, Tony Houghton wrote:
> > I take it you're not keen on my other idea about making it easier to
> > access individual items in a list?
> 
> Well, I'd be concerned about the efficiency; what if someone iterates
> over a list with a network round trip for each item?

You could maybe warn against that sort of thing in the docs.

> There's also some implementation complexity I imagine.
> 
> An argument for it though is that getting, modifying, and resetting a
> list is current not an atomic operation, to avoid races you really need
> a way to make an "append to list" or "insert into list" request.

If you can use some internal locking functions it could be implemented
simply by:

lock
read list
delete/change item, or copy it for reading
write list if it's changed
lock

It wouldn't make operating on single items any more efficient, but at
least it would provide a convenient API for users.

-- 
TH * http://www.realh.co.uk



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]