On Tue, 8 Jul 2008, Bluebie, Jenna wrote:
Heya guys. Some of you know that i've written a nifty little rpc doodad over
the last few days called Legs (yeah, i'm soooo creative...). So, here's what
i've got to work with:
I can define a class, put public methods in it.
And, I can create an object, and when I call a method on that object, it
marshals it all up in a warm gooey JSON wrapping and flies off through the
internet to the server, which also has a class with a bunch of methods in it,
calls the method, the response comes back down the wire.. Super duper magical
nifty rpc thingo makes it like i'm calling an instance of the class on the
server, but remotely. I can also do Notification calls which require no
Have you looked at DRb? It sounds like you've re-invented something like it
(which may not be a bad thing, yours may well have differences with
associated benefits.) DRb is also known as druby.
response, and asynchronous ajax style calls that pass the response off to a
block when it gets back.
And the app I want to build (in time for shoes day, no less) is a simple
replication of IRC, so sure, I can make some requests, get a list of
available channels, join, part channels... but then what? How do I make this
class that exists outside of the scope of the Shoes.app, to update shoes when
events happen? Should I try to build some kind of a thing where the Legs
class thingo tries to maintain an object representing the server state and
then the Shoes UI somehow subscribes to the object and completely refreshes
itself when the object changes? Could I do that with Observable from the
Yes, that would be a well-known way to achieve this. There is DRb::Observable
as well. You'd probably need to make both ends into servers, so that the
far side [Pause as one of Gary Larson's cows wanders past] can instruct the
local server to do something.
standard library? does it have any ability to automatically make stuff like
hashes observable or would I need to reinvent the hash, the array, the
Can't remember.
string, all to have observable functionality to make that work?
You might want to look at Rinda and Tuplespaces because they have
a pool of "tuples" which can be matched and changed by clients, and
observed of course. You might want to have a big tuplespace for all
messages and you only look for those coming to you. Not sure how to
make this secure off the top of my head, so people can't peek at each
other's "post". Maybe add HMAC hashes to the tuples or something.
But I think the answer is yes, because one cannot know in advance
which aspects of the hash would need to work across the network.
It would depend on the application, Eg some want it read-only.
Gosh it'd be nice if Shoes could somehow one day do Flex-style bindings and
automatically work with stuff like this.
HTH
Hugh