Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
thread-pool.hh File Reference
#include "lix/libutil/async.hh"
#include "lix/libutil/async-collect.hh"
#include "lix/libutil/error.hh"
#include "lix/libutil/result.hh"
#include "lix/libutil/sync.hh"
#include <kj/async.h>
#include <map>
#include <queue>
#include <functional>
#include <thread>
#include <atomic>

Go to the source code of this file.

Classes

class  nix::ThreadPool

Functions

 nix::MakeError (ThreadPoolShutDown, Error)
template<typename T>
void nix::processGraph (const char *poolName, const std::set< T > &nodes, std::function< std::set< T >(AsyncIoRoot &, const T &)> getEdges, std::function< void(AsyncIoRoot &, const T &)> processNode)
template<typename T>
void nix::processGraph (const char *poolName, const std::set< T > &nodes, std::function< std::set< T >(const T &)> getEdges, std::function< void(const T &)> processNode)
template<typename T>
kj::Promise< Result< void > > nix::processGraphAsync (const std::set< T > &nodes, std::function< kj::Promise< Result< std::set< T > > >(const T &)> getEdges, std::function< kj::Promise< Result< void > >(const T &)> processNode)

Function Documentation

◆ processGraph()

template<typename T>
void nix::processGraph ( const char * poolName,
const std::set< T > & nodes,
std::function< std::set< T >(AsyncIoRoot &, const T &)> getEdges,
std::function< void(AsyncIoRoot &, const T &)> processNode )

Process in parallel a set of items of type T that have a partial ordering between them. Thus, any item is only processed after all its dependencies have been processed.