This refactors the RequestHandler code, to decouple RequestHandler
behavior from the Server implementation. The goal is to make it easier
to define additional Server implementations, in addition to just
LibEventServer.
This adds a RequestHandlerFactory function, rather than using a pure
virtual method of the Server class. With the old model, you had to
subclass each server implementation separately for each RequestHandler
type you wanted to use, resulting in NxM classes if you have N server
types and M request handler types.
This also changes the behavior of the RequestHandler class somewhat:
the code now only creates a single RequestHandler per thread, and uses
that object for all request in that thread. Previously the
LibEventServer code would attempt to create a new RequestHandler object
for each request if supportReset() returned true. This was used by
RPCRequestHandler. Now the RPCRequestHandler instead just resets itself
automatically when necessary, without requiring external help from
LibEventServer.
contbuild test runs failed due to git server issues.
Doesn't eliminate the Variant(litstr) constructor, or the
same/equals/more/less/etc helpers called from comparisons.h;
those will come in a followon diff.
I was learning from @jdelong and he said that you should use
double quotes for local includes and angle brackets for library
includes. I asked why our code was the way it was, and he said he wanted
to clean it up. I beat him to it :)
Conflicts:
hphp/runtime/base/server/admin_request_handler.cpp
hphp/runtime/vm/named_entity.h
This gets rid of the (litstr) StringData and StackStringData
constructors, but keeps String(litstr). Also rename all
the instances of AttachLiteral to CopyString, since they now
mean the same thing.
This change is mostly for FB internal organizational reasons.
Building is not effected beyond the fact that the target now
lands in hphp/hhvm/hhvm rather than src/hhvm/hhvm.