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)
|
||||
makeRequestR input = do
|
||||
|
||||
t <- getTimeCoarse <&> round @_ @Word64 . realToFrac
|
||||
|
||||
n <- liftIO $ randomIO @Word64
|
||||
rnum <- atomically do
|
||||
n <- readTVar rnumnum
|
||||
modifyTVar' rnumnum succ
|
||||
pure (fromIntegral $ hash (n+t))
|
||||
pure (fromIntegral n)
|
||||
|
||||
pure $ ServiceRequest rnum (serialise (fromIntegral idx :: Int, serialise input))
|
||||
where
|
||||
|
|
Loading…
Reference in New Issue