mirror of https://github.com/voidlizard/hbs2
most probably fix rpc lock issue
This commit is contained in:
parent
dd310888a5
commit
8ca4dd79bf
|
@ -131,13 +131,11 @@ makeRequestR :: forall api method e m . ( KnownNat (FromJust (FindMethodIndex 0
|
||||||
)
|
)
|
||||||
=> Input method -> m (ServiceProto api e)
|
=> Input method -> m (ServiceProto api e)
|
||||||
makeRequestR input = do
|
makeRequestR input = do
|
||||||
|
n <- liftIO $ randomIO @Word64
|
||||||
t <- getTimeCoarse <&> round @_ @Word64 . realToFrac
|
|
||||||
|
|
||||||
rnum <- atomically do
|
rnum <- atomically do
|
||||||
n <- readTVar rnumnum
|
n <- readTVar rnumnum
|
||||||
modifyTVar' rnumnum succ
|
modifyTVar' rnumnum succ
|
||||||
pure (fromIntegral $ hash (n+t))
|
pure (fromIntegral n)
|
||||||
|
|
||||||
pure $ ServiceRequest rnum (serialise (fromIntegral idx :: Int, serialise input))
|
pure $ ServiceRequest rnum (serialise (fromIntegral idx :: Int, serialise input))
|
||||||
where
|
where
|
||||||
|
|
Loading…
Reference in New Issue