Jens,
> > Here is what I think you are suggesting:
> > service SlowRunner { ... }
> > service SlowStopper { ... }
>
> I don't think that two different services are really necessary. In fact,
I
> would not even recommend it for your particular case.
Yep, you're right. Two services don't make much sense there. Put the
stopEverything function in the SlowRunner service and I think stuff makes
sense again.
> You didn't say that in your use case description.
I apologize. I'm trying to be helpful without pre-announcing anything
from my company. I think I've come up with some better explanations
though.
Right now, I'm working with several cases where something that is
currently in-process needs to move out-of-process. The in-process code
has a well defined API, and I want to keep something extremely similar to
that API where possible. The in-process code often has sessions and
objects that can be operated on from multiple threads in a thread safe
way. Some of these operations are I/O operations with client specified
time-outs. These APIs provide a way to cancel a session's I/O from
another thread.
Most (but not all) of these use cases already have session objects that
would be a very reasonable place to put a thrift client. The servers are
likely to be resource constrained though. If at all possible, I want to
maintain the assumptions that calling code had before. Basically, code
that wasn't serialized in-process before shouldn't be serialized in the
out-of-process case.
So I'll argue that I got separation of concerns down first :). The API
concern was "solved" before I even started researching Thrift. I just
want a server (and a client) that will guard the internal transport
appropriately so that one blocked request doesn't stall other, newer
requests on the same transport.
> > My desired interface is actually more like this:
> > service GenericService> {
> > string doSomething(1: string cmd),
> > }
>
> So you are adding one interface (your command line syntax) on top of a
> different interface (Thrift)? ;-)
Yep, Thrift is my golden hammer of choice right now. (
http://en.wikipedia.org/wiki/Law_of_the_instrument)
It seems a lot easier to use the servers, clients, and transports as
provided in Thrift than to re-roll all of that, even if the end result
might be a little simpler and smaller.