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