This commit is contained in:
Dmitriy Ryajov 2020-04-22 16:04:46 -06:00
parent fc7716f739
commit ed37c8c439
No known key found for this signature in database
GPG Key ID: DA8C680CE7C657A4
3 changed files with 3 additions and 4 deletions

View File

@ -17,7 +17,6 @@ logScope:
const
DefaultChunkSize* = 1 shl 20 # 1MB
EofTag: seq[byte] = @[]
type
ChronosStream* = ref object of Stream[seq[byte]]

View File

@ -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")

View File

@ -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!")