Nix
2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Toggle main menu visibility
Loading...
Searching...
No Matches
worker-protocol-connection.hh
Go to the documentation of this file.
1
#pragma once
3
4
#include "
nix/store/worker-protocol.hh
"
5
#include "
nix/store/store-api.hh
"
6
7
namespace
nix {
8
9
struct
WorkerProto::BasicConnection
10
{
14
FdSink
to
;
15
19
FdSource
from
;
20
24
WorkerProto::Version
protoVersion
;
25
34
operator
WorkerProto::ReadConn
()
35
{
36
return
WorkerProto::ReadConn
{
37
.from =
from
,
38
.version =
protoVersion
,
39
};
40
}
41
50
operator
WorkerProto::WriteConn
()
51
{
52
return
WorkerProto::WriteConn
{
53
.to =
to
,
54
.version =
protoVersion
,
55
};
56
}
57
};
58
59
struct
WorkerProto::BasicClientConnection
:
WorkerProto::BasicConnection
60
{
64
virtual
~BasicClientConnection
();
65
66
virtual
void
closeWrite() = 0;
67
68
std::exception_ptr processStderrReturn(
Sink
* sink = 0,
Source
* source = 0,
bool
flush =
true
,
bool
block =
true
);
69
70
void
71
processStderr(
bool
* daemonException,
Sink
* sink = 0,
Source
* source = 0,
bool
flush =
true
,
bool
block =
true
);
72
88
// FIXME: this should probably be a constructor.
89
static
Version
handshake
(
BufferedSink
&
to
,
Source
&
from
,
const
Version
& localVersion);
90
95
ClientHandshakeInfo
postHandshake
(
const
StoreDirConfig
& store);
96
97
void
addTempRoot(
const
StoreDirConfig
& remoteStore,
bool
* daemonException,
const
StorePath
& path);
98
99
StorePathSet queryValidPaths(
100
const
StoreDirConfig
& remoteStore,
101
bool
* daemonException,
102
const
StorePathSet & paths,
103
SubstituteFlag maybeSubstitute);
104
105
std::optional<UnkeyedValidPathInfo>
106
queryPathInfo(
const
StoreDirConfig
& store,
bool
* daemonException,
const
StorePath
& path);
107
108
void
putBuildDerivationRequest(
109
const
StoreDirConfig
& store,
110
bool
* daemonException,
111
const
StorePath
& drvPath,
112
const
BasicDerivation & drv,
113
BuildMode buildMode);
114
119
BuildResult
getBuildDerivationResponse
(
const
StoreDirConfig
& store,
bool
* daemonException);
120
121
void
narFromPath(
122
const
StoreDirConfig
& store,
bool
* daemonException,
const
StorePath
& path,
fun
<
void
(
Source
&)> receiveNar);
123
};
124
125
struct
WorkerProto::BasicServerConnection
:
WorkerProto::BasicConnection
126
{
142
// FIXME: this should probably be a constructor.
143
static
Version
handshake
(
BufferedSink
&
to
,
Source
&
from
,
const
Version
& localVersion);
144
149
void
postHandshake
(
const
StoreDirConfig
& store,
const
ClientHandshakeInfo
& info);
150
};
151
152
}
// namespace nix
nix::BufferedSink
Definition
serialise.hh:60
nix::StorePath
Definition
path.hh:33
nix::fun
Definition
fun.hh:19
store-api.hh
nix::BuildResult
Definition
build-result.hh:123
nix::FdSink
Definition
serialise.hh:194
nix::FdSource
Definition
serialise.hh:246
nix::Sink
Definition
serialise.hh:18
nix::Source
Definition
serialise.hh:95
nix::StoreDirConfig
Definition
store-dir-config.hh:29
nix::WorkerProto::BasicClientConnection
Definition
worker-protocol-connection.hh:60
nix::WorkerProto::BasicClientConnection::getBuildDerivationResponse
BuildResult getBuildDerivationResponse(const StoreDirConfig &store, bool *daemonException)
Definition
worker-protocol-connection.cc:282
nix::WorkerProto::BasicClientConnection::postHandshake
ClientHandshakeInfo postHandshake(const StoreDirConfig &store)
Definition
worker-protocol-connection.cc:196
nix::WorkerProto::BasicClientConnection::handshake
static Version handshake(BufferedSink &to, Source &from, const Version &localVersion)
Definition
worker-protocol-connection.cc:138
nix::WorkerProto::BasicConnection
Definition
worker-protocol-connection.hh:10
nix::WorkerProto::BasicConnection::protoVersion
WorkerProto::Version protoVersion
Definition
worker-protocol-connection.hh:24
nix::WorkerProto::BasicConnection::to
FdSink to
Definition
worker-protocol-connection.hh:14
nix::WorkerProto::BasicConnection::from
FdSource from
Definition
worker-protocol-connection.hh:19
nix::WorkerProto::BasicServerConnection
Definition
worker-protocol-connection.hh:126
nix::WorkerProto::BasicServerConnection::postHandshake
void postHandshake(const StoreDirConfig &store, const ClientHandshakeInfo &info)
Definition
worker-protocol-connection.cc:214
nix::WorkerProto::BasicServerConnection::handshake
static Version handshake(BufferedSink &to, Source &from, const Version &localVersion)
Definition
worker-protocol-connection.cc:170
nix::WorkerProto::ClientHandshakeInfo
Definition
worker-protocol.hh:288
nix::WorkerProto::ReadConn
Definition
worker-protocol.hh:164
nix::WorkerProto::Version
Definition
worker-protocol.hh:70
nix::WorkerProto::WriteConn
Definition
worker-protocol.hh:174
worker-protocol.hh
libstore
include
nix
store
worker-protocol-connection.hh
Generated by
1.18.0