diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-02-25T10·25+0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-02-25T10·25+0100 |
commit | f1bdeac9864de8cd9994bb41da79f3a4d812dadc (patch) | |
tree | 9ea00480f826dc8d8d8248e11323266a42f9d4ae /src/libstore/remote-store.hh | |
parent | 9b05d5848c2fce73b75b3411e362c2bd48d53dcb (diff) | |
parent | 152b1d6bf9c89b4db9848475e3000821e159d479 (diff) |
Merge branch 'master' into new-cli
Diffstat (limited to 'src/libstore/remote-store.hh')
-rw-r--r-- | src/libstore/remote-store.hh | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/src/libstore/remote-store.hh b/src/libstore/remote-store.hh index f15182285e8c..ddfb70a669a0 100644 --- a/src/libstore/remote-store.hh +++ b/src/libstore/remote-store.hh @@ -1,5 +1,6 @@ #pragma once +#include <limits> #include <string> #include "store-api.hh" @@ -12,15 +13,14 @@ class Pipe; class Pid; struct FdSink; struct FdSource; +template<typename T> class Pool; class RemoteStore : public Store { public: - RemoteStore(); - - ~RemoteStore(); + RemoteStore(size_t maxConnections = std::numeric_limits<size_t>::max()); /* Implementations of abstract store API methods. */ @@ -91,19 +91,24 @@ public: bool verifyStore(bool checkContents, bool repair) override; private: - AutoCloseFD fdSocket; - FdSink to; - FdSource from; - unsigned int daemonVersion; - bool initialised; - void openConnection(bool reserveSpace = true); + struct Connection + { + AutoCloseFD fd; + FdSink to; + FdSource from; + unsigned int daemonVersion; + + ~Connection(); + + void processStderr(Sink * sink = 0, Source * source = 0); + }; - void processStderr(Sink * sink = 0, Source * source = 0); + ref<Pool<Connection>> connections; - void connectToDaemon(); + ref<Connection> openConnection(); - void setOptions(); + void setOptions(ref<Connection> conn); }; |