mirror of https://github.com/voidlizard/hbs2
wtf
This commit is contained in:
parent
d5ea301ffc
commit
1bdf9e58ae
|
@ -40,7 +40,10 @@ newtype ChunkId = ChunkId FilePath
|
||||||
deriving newtype (IsString)
|
deriving newtype (IsString)
|
||||||
deriving stock (Eq,Ord,Show)
|
deriving stock (Eq,Ord,Show)
|
||||||
|
|
||||||
data ChunkWriter h m = forall a . (MonadIO m, Storage a h ByteString m, Block ByteString ~ ByteString) =>
|
data ChunkWriter h m = forall a . ( MonadIO m
|
||||||
|
, Storage a h ByteString m
|
||||||
|
, Block ByteString ~ ByteString
|
||||||
|
) =>
|
||||||
ChunkWriter
|
ChunkWriter
|
||||||
{ pipeline :: Pipeline m ()
|
{ pipeline :: Pipeline m ()
|
||||||
, dir :: FilePath
|
, dir :: FilePath
|
||||||
|
@ -57,7 +60,7 @@ runChunkWriter w = do
|
||||||
stopChunkWriter :: MonadIO m => ChunkWriter h m -> m ()
|
stopChunkWriter :: MonadIO m => ChunkWriter h m -> m ()
|
||||||
stopChunkWriter w = stopPipeline ( pipeline w )
|
stopChunkWriter w = stopPipeline ( pipeline w )
|
||||||
|
|
||||||
newChunkWriterIO :: forall h a m . ( Key h ~ Hash h
|
newChunkWriterIO :: forall h a m . ( Key h ~ Hash h, h ~ HbSync
|
||||||
, Storage a h ByteString m
|
, Storage a h ByteString m
|
||||||
, Block ByteString ~ ByteString
|
, Block ByteString ~ ByteString
|
||||||
, MonadIO m
|
, MonadIO m
|
||||||
|
@ -155,6 +158,7 @@ getHash w salt h = liftIO do
|
||||||
commitBlock :: forall salt h m .
|
commitBlock :: forall salt h m .
|
||||||
( Hashable salt
|
( Hashable salt
|
||||||
, Hashed h ByteString
|
, Hashed h ByteString
|
||||||
|
, Block ByteString ~ ByteString
|
||||||
, MonadIO m
|
, MonadIO m
|
||||||
, Pretty (Hash h)
|
, Pretty (Hash h)
|
||||||
)
|
)
|
||||||
|
|
|
@ -374,7 +374,7 @@ runTestPeer p zu = do
|
||||||
let opts = [ StoragePrefix dir
|
let opts = [ StoragePrefix dir
|
||||||
]
|
]
|
||||||
|
|
||||||
stor <- simpleStorageInit @_ @_ @HbSync opts
|
stor <- simpleStorageInit opts
|
||||||
cww <- newChunkWriterIO stor (Just chDir)
|
cww <- newChunkWriterIO stor (Just chDir)
|
||||||
|
|
||||||
sw <- liftIO $ async $ simpleStorageWorker stor
|
sw <- liftIO $ async $ simpleStorageWorker stor
|
||||||
|
|
Loading…
Reference in New Issue