Comments
Patch
new file mode 100644
@@ -0,0 +1,23 @@
+# Copyright 2012 Facebook
+#
+# This software may be used and distributed according to the terms of the
+# GNU General Public License version 2 or any later version.
+
+"""Local client/server communication conforming to the abstract interface
+
+`Local` means client and server are run in the same interpreter instance.
+"""
+
+import transport
+
+class localclient(transport.clientproxy):
+ """Talks directly to the history server.
+
+ Used when server and client are run in the same interpreter instance.
+ """
+
+ def __init__(self, server):
+ self._server = server
+
+ def request(self, queryname, args):
+ return getattr(self._server, queryname)(*args)
new file mode 100644
@@ -0,0 +1,12 @@
+# Copyright 2012 Facebook
+#
+# This software may be used and distributed according to the terms of the
+# GNU General Public License version 2 or any later version.
+
+"""Abstracting low-level details of the client/server communication."""
+
+class clientproxy(object):
+
+ def request(queryname, args):
+ raise NotImplementedError
+