Want to pick your brains about client design:

(if you don't know, assume neuroses is the same
as whiterose and redrose is an old whiterose design)

Under redrose, I implimented the event loop for each platform. So for
the GTK client I wrote an event loop which wrapped the gtk_* calls
for waiting on file descriptors. For the command line client I used
the main event loop. A KDE version would need another wrapper etc.

This isn't a scalable solution. If people want to write clients in 
Python/Perl/GTK/Qt/FLTK/whatever then they don't want to be getting
their hands dirty with eloop code, assuming the platform has ways to
wait on fds anyway.

So the obvious solution is to put the neuroses code in its own place
and the make the clients communicate with it over a socket or pipe. 
Neuroses and the client can then do whatever they want with their
eloops.

This much is ok. The question is where do I put the client code?

I could put it in a thread. Each client would have 2 (or more)
threads. One would be neuroses and the rest would be the client.
Client and Neuroses would communicate via a socket pair. Even with
shared libraries, this could be quite bloated. (thou nothing like
fred is ;)

Or I could put it in the node itself. The node would have a 
separate port, only open to localhost, which clients could
connect to. This would mean that people *have* to run a local
node, which is ok because people should always run a local node.
But it would mean that people have to run a Whiterose local node,
which isn't so great. It would be the most memory efficient
solution if people were running a node anyway, and the code
wouldn't have any communication overhead with the node.

The final solution (unless you have others) is to have a seperate
process which clients could connect to, and which would forward
messages to a local node. It's basically the same as the last
solution except that the node would be minimal (without a 
DataStore) and would just forward requests.

Comments sought.

AGL

-- 
The herd instinct among economists makes sheep look like independent thinkers

PGP signature

Reply via email to