1--types shared across server and client modules
2module ProjectM36.Server.Types where
3import StmContainers.Set as StmSet
6import ProjectM36.Sessions
7import Control.Concurrent.STM
8import ProjectM36.ScriptSession
9import ProjectM36.FileLock
10import Control.Concurrent.MVar
11import ProjectM36.TransactionGraph.Persist
12import Network.RPC.Curryer.Server as RPC
15-- | The 'Connection' represents either local or remote access to a database. All operations flow through the connection.
16type ClientNodes = StmSet.Set ClientInfo
18type DatabaseName = String
20-- internal structure specific to in-process connections
21data InProcessConnectionConf = InProcessConnectionConf {
22 ipPersistenceStrategy :: PersistenceStrategy,
23 ipClientNodes :: ClientNodes,
24 ipSessions :: Sessions,
25 ipTransactionGraph :: TVar TransactionGraph,
26 ipScriptSession :: Maybe ScriptSession,
27 ipLocks :: Maybe (LockFile, MVar LockFileHash) -- nothing when NoPersistence
30-- clients may connect associate one socket with one database
31data ClientInfo = ClientInfo { clientDatabaseName :: DatabaseName,
32 clientSocket :: RPC.Locking Socket }
34instance Eq ClientInfo where
35 a == b = RPC.lockless (clientSocket a) == RPC.lockless (clientSocket b)
37instance Hashable ClientInfo where
38 hashWithSalt salt ci = hashWithSalt salt (show (RPC.lockless (clientSocket ci)))
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list