[PATCH 3 of 7] commandserver: add new forking server implemented without using SocketServer
Yuya Nishihara
yuya at tcha.org
Fri Jul 15 21:04:25 EDT 2016
On Fri, 15 Jul 2016 17:29:50 +0100, Jun Wu wrote:
> Excerpts from Yuya Nishihara's message of 2016-07-16 01:02:51 +0900:
> > > > + def _serveworker(self, conn):
> > >
> > > I find the name "_serveworker" a bit ambiguous. "serve" is usually a verb
> > > and iiuc it's used as a noun here. Maybe just use "_serverequest" or move it
> > > to mainloop (makes sense to me since it's simple and the fork logic is
> > > already there, and I think we don't care about subclass now).
> >
> > I'm going to move the initialization of the worker process to this function,
> > which is why I avoid calling it _serverequest(). If we add a prefork server,
> > setpgid() and random.seed() shouldn't be executed per request, so they will
> > be moved from _serverequest() to unixforkingservice._serveworker().
>
> Then how about "_runworker"? Anyway I don't feel strong as we don't need to
> care about subclassing now.
Sounds better. I'll send a follow-up patch.
More information about the Mercurial-devel
mailing list