[broker] Ord instance of MessageId

parent 72ad625b
Pipeline #6866 failed with stages
in 1 minute and 38 seconds
......@@ -43,7 +43,7 @@ instance (SerializableMessage a, Show a) => MessageBroker PGMQBroker a where
deriving (Show)
data Message PGMQBroker a = PGMQM a
data MessageId PGMQBroker = PGMQMid Int
deriving (Eq, Show)
deriving (Eq, Show, Ord)
data BrokerInitParams PGMQBroker a =
PGMQBrokerInitParams PSQL.ConnectInfo PGMQ.VisibilityTimeout
| PGMQBrokerInitConnStr BS.ByteString PGMQ.VisibilityTimeout
......
......@@ -56,7 +56,7 @@ instance (SerializableMessage a, Show a) => MessageBroker RedisBroker a where
deriving (Show)
data Message RedisBroker a = RedisM a
data MessageId RedisBroker = RedisMid Int
deriving (Eq, Show)
deriving (Eq, Show, Ord)
data BrokerInitParams RedisBroker a = RedisBrokerInitParams Redis.ConnectInfo
messageId (RedisBM (RedisWithMsgId { rmidId })) = RedisMid rmidId
......
......@@ -47,7 +47,7 @@ instance (Show a) => MessageBroker STMBroker a where
deriving (Show)
data Message STMBroker a = STMM a
data MessageId STMBroker = STMMid Int
deriving (Eq, Show)
deriving (Eq, Show, Ord)
data BrokerInitParams STMBroker a =
STMBrokerInitParams { archiveMap :: TVar (Map.Map Queue (Map.Map Int (STMWithMsgId a)))
, stmMap :: TVar (Map.Map Queue (Map.Map Int (STMWithMsgId a))) }
......
......@@ -84,6 +84,7 @@ type SerializableMessage a = ( FromJSON a
class (
Eq (MessageId b)
, Show (MessageId b)
, Ord (MessageId b)
, ToJSON (MessageId b)
, FromJSON (MessageId b)
, Show (BrokerMessage b a)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment