simplexmq-6.5.0.16: SimpleXMQ message broker
Safe HaskellSafe-Inferred
LanguageHaskell2010

Simplex.Messaging.Server.QueueStore.Types

Documentation

class StoreQueueClass q where Source #

Methods

recipientId :: q -> RecipientId Source #

queueRec :: q -> TVar (Maybe QueueRec) Source #

withQueueLock :: q -> Text -> IO a -> IO a Source #

Instances

Instances details
StoreQueueClass STMQueue Source # 
Instance details

Defined in Simplex.Messaging.Server.MsgStore.STM

Methods

recipientId :: STMQueue -> RecipientId Source #

queueRec :: STMQueue -> TVar (Maybe QueueRec) Source #

withQueueLock :: STMQueue -> Text -> IO a -> IO a Source #

StoreQueueClass (JournalQueue s) Source # 
Instance details

Defined in Simplex.Messaging.Server.MsgStore.Journal

Methods

recipientId :: JournalQueue s -> RecipientId Source #

queueRec :: JournalQueue s -> TVar (Maybe QueueRec) Source #

withQueueLock :: JournalQueue s -> Text -> IO a -> IO a Source #

class StoreQueueClass q => QueueStoreClass q s where Source #

Associated Types

type QueueStoreCfg s Source #

Methods

newQueueStore :: QueueStoreCfg s -> IO s Source #

closeQueueStore :: s -> IO () Source #

getEntityCounts :: s -> IO EntityCounts Source #

loadedQueues :: s -> TMap RecipientId q Source #

compactQueues :: s -> IO Int64 Source #

addQueue_ :: s -> (RecipientId -> QueueRec -> IO q) -> RecipientId -> QueueRec -> IO (Either ErrorType q) Source #

getQueue_ :: QueueParty p => s -> (Bool -> RecipientId -> QueueRec -> IO q) -> SParty p -> QueueId -> IO (Either ErrorType q) Source #

getQueues_ :: BatchParty p => s -> (Bool -> RecipientId -> QueueRec -> IO q) -> SParty p -> [QueueId] -> IO [Either ErrorType q] Source #

getQueueLinkData :: s -> q -> LinkId -> IO (Either ErrorType QueueLinkData) Source #

addQueueLinkData :: s -> q -> LinkId -> QueueLinkData -> IO (Either ErrorType ()) Source #

deleteQueueLinkData :: s -> q -> IO (Either ErrorType ()) Source #

secureQueue :: s -> q -> SndPublicAuthKey -> IO (Either ErrorType ()) Source #

updateKeys :: s -> q -> NonEmpty RcvPublicAuthKey -> IO (Either ErrorType ()) Source #

addQueueNotifier :: s -> q -> NtfCreds -> IO (Either ErrorType (Maybe NtfCreds)) Source #

deleteQueueNotifier :: s -> q -> IO (Either ErrorType (Maybe NtfCreds)) Source #

suspendQueue :: s -> q -> IO (Either ErrorType ()) Source #

blockQueue :: s -> q -> BlockingInfo -> IO (Either ErrorType ()) Source #

unblockQueue :: s -> q -> IO (Either ErrorType ()) Source #

updateQueueTime :: s -> q -> SystemDate -> IO (Either ErrorType QueueRec) Source #

deleteStoreQueue :: s -> q -> IO (Either ErrorType QueueRec) Source #

getCreateService :: s -> ServiceRec -> IO (Either ErrorType ServiceId) Source #

setQueueService :: (PartyI p, ServiceParty p) => s -> q -> SParty p -> Maybe ServiceId -> IO (Either ErrorType ()) Source #

getQueueNtfServices :: s -> [(NotifierId, a)] -> IO (Either ErrorType ([(Maybe ServiceId, [(NotifierId, a)])], [(NotifierId, a)])) Source #

getServiceQueueCount :: (PartyI p, ServiceParty p) => s -> SParty p -> ServiceId -> IO (Either ErrorType Int64) Source #

Instances

Instances details
StoreQueueClass q => QueueStoreClass q (STMQueueStore q) Source # 
Instance details

Defined in Simplex.Messaging.Server.QueueStore.STM

Associated Types

type QueueStoreCfg (STMQueueStore q) Source #

Methods

newQueueStore :: QueueStoreCfg (STMQueueStore q) -> IO (STMQueueStore q) Source #

closeQueueStore :: STMQueueStore q -> IO () Source #

getEntityCounts :: STMQueueStore q -> IO EntityCounts Source #

loadedQueues :: STMQueueStore q -> TMap RecipientId q Source #

compactQueues :: STMQueueStore q -> IO Int64 Source #

addQueue_ :: STMQueueStore q -> (RecipientId -> QueueRec -> IO q) -> RecipientId -> QueueRec -> IO (Either ErrorType q) Source #

getQueue_ :: forall (p :: Party). QueueParty p => STMQueueStore q -> (Bool -> RecipientId -> QueueRec -> IO q) -> SParty p -> QueueId -> IO (Either ErrorType q) Source #

getQueues_ :: forall (p :: Party). BatchParty p => STMQueueStore q -> (Bool -> RecipientId -> QueueRec -> IO q) -> SParty p -> [QueueId] -> IO [Either ErrorType q] Source #

getQueueLinkData :: STMQueueStore q -> q -> LinkId -> IO (Either ErrorType QueueLinkData) Source #

addQueueLinkData :: STMQueueStore q -> q -> LinkId -> QueueLinkData -> IO (Either ErrorType ()) Source #

deleteQueueLinkData :: STMQueueStore q -> q -> IO (Either ErrorType ()) Source #

secureQueue :: STMQueueStore q -> q -> SndPublicAuthKey -> IO (Either ErrorType ()) Source #

updateKeys :: STMQueueStore q -> q -> NonEmpty RcvPublicAuthKey -> IO (Either ErrorType ()) Source #

addQueueNotifier :: STMQueueStore q -> q -> NtfCreds -> IO (Either ErrorType (Maybe NtfCreds)) Source #

deleteQueueNotifier :: STMQueueStore q -> q -> IO (Either ErrorType (Maybe NtfCreds)) Source #

suspendQueue :: STMQueueStore q -> q -> IO (Either ErrorType ()) Source #

blockQueue :: STMQueueStore q -> q -> BlockingInfo -> IO (Either ErrorType ()) Source #

unblockQueue :: STMQueueStore q -> q -> IO (Either ErrorType ()) Source #

updateQueueTime :: STMQueueStore q -> q -> SystemDate -> IO (Either ErrorType QueueRec) Source #

deleteStoreQueue :: STMQueueStore q -> q -> IO (Either ErrorType QueueRec) Source #

getCreateService :: STMQueueStore q -> ServiceRec -> IO (Either ErrorType ServiceId) Source #

setQueueService :: forall (p :: Party). (PartyI p, ServiceParty p) => STMQueueStore q -> q -> SParty p -> Maybe ServiceId -> IO (Either ErrorType ()) Source #

getQueueNtfServices :: STMQueueStore q -> [(NotifierId, a)] -> IO (Either ErrorType ([(Maybe ServiceId, [(NotifierId, a)])], [(NotifierId, a)])) Source #

getServiceQueueCount :: forall (p :: Party). (PartyI p, ServiceParty p) => STMQueueStore q -> SParty p -> ServiceId -> IO (Either ErrorType Int64) Source #

QueueStoreClass (JournalQueue s) (QStore s) Source # 
Instance details

Defined in Simplex.Messaging.Server.MsgStore.Journal

Associated Types

type QueueStoreCfg (QStore s) Source #

Methods

newQueueStore :: QueueStoreCfg (QStore s) -> IO (QStore s) Source #

closeQueueStore :: QStore s -> IO () Source #

getEntityCounts :: QStore s -> IO EntityCounts Source #

loadedQueues :: QStore s -> TMap RecipientId (JournalQueue s) Source #

compactQueues :: QStore s -> IO Int64 Source #

addQueue_ :: QStore s -> (RecipientId -> QueueRec -> IO (JournalQueue s)) -> RecipientId -> QueueRec -> IO (Either ErrorType (JournalQueue s)) Source #

getQueue_ :: forall (p :: Party). QueueParty p => QStore s -> (Bool -> RecipientId -> QueueRec -> IO (JournalQueue s)) -> SParty p -> QueueId -> IO (Either ErrorType (JournalQueue s)) Source #

getQueues_ :: forall (p :: Party). BatchParty p => QStore s -> (Bool -> RecipientId -> QueueRec -> IO (JournalQueue s)) -> SParty p -> [QueueId] -> IO [Either ErrorType (JournalQueue s)] Source #

getQueueLinkData :: QStore s -> JournalQueue s -> LinkId -> IO (Either ErrorType QueueLinkData) Source #

addQueueLinkData :: QStore s -> JournalQueue s -> LinkId -> QueueLinkData -> IO (Either ErrorType ()) Source #

deleteQueueLinkData :: QStore s -> JournalQueue s -> IO (Either ErrorType ()) Source #

secureQueue :: QStore s -> JournalQueue s -> SndPublicAuthKey -> IO (Either ErrorType ()) Source #

updateKeys :: QStore s -> JournalQueue s -> NonEmpty RcvPublicAuthKey -> IO (Either ErrorType ()) Source #

addQueueNotifier :: QStore s -> JournalQueue s -> NtfCreds -> IO (Either ErrorType (Maybe NtfCreds)) Source #

deleteQueueNotifier :: QStore s -> JournalQueue s -> IO (Either ErrorType (Maybe NtfCreds)) Source #

suspendQueue :: QStore s -> JournalQueue s -> IO (Either ErrorType ()) Source #

blockQueue :: QStore s -> JournalQueue s -> BlockingInfo -> IO (Either ErrorType ()) Source #

unblockQueue :: QStore s -> JournalQueue s -> IO (Either ErrorType ()) Source #

updateQueueTime :: QStore s -> JournalQueue s -> SystemDate -> IO (Either ErrorType QueueRec) Source #

deleteStoreQueue :: QStore s -> JournalQueue s -> IO (Either ErrorType QueueRec) Source #

getCreateService :: QStore s -> ServiceRec -> IO (Either ErrorType ServiceId) Source #

setQueueService :: forall (p :: Party). (PartyI p, ServiceParty p) => QStore s -> JournalQueue s -> SParty p -> Maybe ServiceId -> IO (Either ErrorType ()) Source #

getQueueNtfServices :: QStore s -> [(NotifierId, a)] -> IO (Either ErrorType ([(Maybe ServiceId, [(NotifierId, a)])], [(NotifierId, a)])) Source #

getServiceQueueCount :: forall (p :: Party). (PartyI p, ServiceParty p) => QStore s -> SParty p -> ServiceId -> IO (Either ErrorType Int64) Source #

withLoadedQueues :: (Monoid a, QueueStoreClass q s) => s -> (q -> IO a) -> IO a Source #