* TaskBuildIndex starts seperate indexer processes and communicates via shared memory * indexer processes get restarted if they fail * indexer processes are killed when the app closes or crashes * added utility class SharedMemory to allocate and access shared memory, providing basic data structures * added SharedMemoryGarbageCollector for keeping track of running instances and cleaning up shared memory in case of a crash * show errors for source files that crashed during indexing * added basic exception handling to task scheduling * added option to turn off processes and use threads in preferences, but still use shared memory fortune cookie message = Good news from someone dear is coming soon.
28 lines
806 B
C++
28 lines
806 B
C++
#ifndef INTERPROCESS_INDEXER_COMMAND_MANAGER_H
|
|
#define INTERPROCESS_INDEXER_COMMAND_MANAGER_H
|
|
|
|
#include "BaseInterprocessDataManager.h"
|
|
#include "shared_types/SharedIndexerCommand.h"
|
|
|
|
class IndexerCommand;
|
|
|
|
class InterprocessIndexerCommandManager
|
|
: public BaseInterprocessDataManager
|
|
{
|
|
public:
|
|
InterprocessIndexerCommandManager(const std::string& instanceUuid, Id processId, bool isOwner);
|
|
virtual ~InterprocessIndexerCommandManager();
|
|
|
|
void setIndexerCommands(const std::vector<std::shared_ptr<IndexerCommand>>& indexerCommands);
|
|
std::shared_ptr<IndexerCommand> popIndexerCommand();
|
|
|
|
void clearIndexerCommands();
|
|
size_t indexerCommandCount();
|
|
|
|
private:
|
|
static const char* s_sharedMemoryNamePrefix;
|
|
static const char* s_indexerCommandsKeyName;
|
|
};
|
|
|
|
#endif // INTERPROCESS_INDEXER_COMMAND_MANAGER_H
|