[java-gnome-hackers] LibUnique
Brought to you by:
afcowie
From: Andrew C. <an...@op...> - 2009-06-17 05:14:46
|
I had a bit of fun yesterday and hacked up preliminary coverage for LibUnique — something I've wanted to do for a while. Some basic scenarios were easy to explore with unit tests and that's where I started; it gets harder to test actual inter-process communication [I didn't really want to fire off other Processes]. Meanwhile I did up a trivial example, and it works: * an initial instance figures out that it is indeed the first * a second instance can find out that another is running. * you can even send messages from a second instance to the unique one. so I'd have to say it "works". Branch is at bzr://research.operationaldynamics.com/bzr/java-gnome/hackers/andrew/unique/ ++ But it is easy to misuse, it seems. Back to the unit tests, I tried to see how far I could push matters I uncovered some strange crashes and/or hangs. So there may be limitations like "once you've become a unique app you can't talk to other unique apps" or "can't talk to yourself". Dunno. The test that I couldn't make work is below. It probably encapsulates several mistaken assumptions. I have a feeling that once a process is bound to LibUnique under a given name, that's it, it cannot bind to another. It'd be nice to get some clarity here to clean up the docs - otherwise it's too easy to misuse, and meanwhile it's a bit difficult to construct a unit test about message payload passing. AfC Sydney |