mirror of
https://github.com/status-im/nim-libp2p.git
synced 2025-02-28 12:30:46 +00:00
wip
This commit is contained in:
parent
fc7716f739
commit
ed37c8c439
@ -17,7 +17,6 @@ logScope:
|
||||
|
||||
const
|
||||
DefaultChunkSize* = 1 shl 20 # 1MB
|
||||
EofTag: seq[byte] = @[]
|
||||
|
||||
type
|
||||
ChronosStream* = ref object of Stream[seq[byte]]
|
||||
|
@ -55,5 +55,5 @@ proc init*(P: type[BytePushable], maxChunkSize = DefaultChunkSize): P =
|
||||
P(queue: newAsyncQueue[seq[byte]](1),
|
||||
maxChunkSize: maxChunkSize,
|
||||
sourceImpl: pushSource,
|
||||
name: "BytePushable",
|
||||
eofTag: @[])
|
||||
eofTag: @[],
|
||||
name: "BytePushable")
|
||||
|
@ -20,11 +20,11 @@ type
|
||||
Duplex*[T] = Source[T] | Sink[T]
|
||||
|
||||
Stream*[T] = ref object of RootObj
|
||||
name*: string
|
||||
eof*: bool
|
||||
sourceImpl*: proc (s: Stream[T]): Source[T] {.gcsafe.}
|
||||
sinkImpl*: proc(s: Stream[T]): Sink[T] {.gcsafe.}
|
||||
eofTag*: T
|
||||
name*: string
|
||||
|
||||
proc newStreamEofError*(): ref StreamEofError =
|
||||
raise newException(StreamEofError, "Stream at EOF!")
|
||||
|
Loading…
x
Reference in New Issue
Block a user