It is increasingly looking like Karta would benefit from being primarily a server application. The graph that it maintains of the file system's relations could conceivably be accessed and modified by multiple applications at the same time. Interoperability = utility. This initial local server implementation would pave the way for sharing and interconnecting graphs across multiple computers as well.
Roughly, these are the steps:
Turn Graph into a trait: define a GraphTrait that encapsulates the core operations. This will allow for multiple implementations.
The "greedy" local implementation: keep the current Graph struct and implement the GraphTrait for it. This will preserve the existing functionality for direct database access. teodosin/karta_server#3
Convert the trait to support async operations. teodosin/karta#95
Implement a local server version: create a new struct, let's call it ServerGraph, that also implements GraphTrait. This implementation will handle communication with the server process.
Automatic server process management: In the ServerGraph implementation, we can add logic to:
Check if a server is already running for the given database
Start a new server process if one isn't running
Connect to the existing server if it's already running
Inter-process management: some resources to perhaps look into:
It is increasingly looking like Karta would benefit from being primarily a server application. The graph that it maintains of the file system's relations could conceivably be accessed and modified by multiple applications at the same time. Interoperability = utility. This initial local server implementation would pave the way for sharing and interconnecting graphs across multiple computers as well.
Roughly, these are the steps:
Turn Graph into a trait: define a GraphTrait that encapsulates the core operations. This will allow for multiple implementations.
The "greedy" local implementation: keep the current Graph struct and implement the GraphTrait for it. This will preserve the existing functionality for direct database access. teodosin/karta_server#3
Convert the trait to support async operations. teodosin/karta#95
Implement a local server version: create a new struct, let's call it ServerGraph, that also implements GraphTrait. This implementation will handle communication with the server process.
Automatic server process management: In the ServerGraph implementation, we can add logic to:
Inter-process management: some resources to perhaps look into: