incubator-libcloud mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jed Smith <...@jedsmith.org>
Subject Re: [libcloud] libcloud roadmap and plans for the future
Date Mon, 07 Feb 2011 15:24:51 GMT
On Mon, Feb 7, 2011 at 10:04 AM, Jerry Chen <jerry@apache.org> wrote:
>
> As long as the abstraction doesn't create weird race conditions, nor forces us to modify
each driver for async stuff to work, I would be okay with this capability. I just can't wrap
my head around how one would test for correctness and stability.

I believe it would. You now need to track what requests you have out
and call the appropriate callback, a very difficult (and tedious
task). A supposedly stateless library just inherited a /lot/ of state.

Anecdote: I solved this problem for the Linode iPhone app. If you're
not familiar with UIKit/Foundation development for iOS, it's all
asynchronous. I spent very many hours debugging the code that did the
linkage between APIRequest instances and the callback event on them.
It got so difficult to do properly with Apple's APIs that I eventually
stumbled upon a hopelessly inelegant solution: every request the
iPhone app makes is a batch, with a test.echo action containing an ID
which is a key into the pending-requests dictionary. Seriously.

That's what asynchronous ends up becoming in a request-receive
environment. It's a rabbit hole of inelegant solutions and a lot of
tedious state tracking in the library.

-- 
Jed Smith
jed@jedsmith.org

Mime
View raw message