Skip to content

Commit

Permalink
#53 - async parsers started off - only really needs F so no need for …
Browse files Browse the repository at this point in the history
…a functions wrapper
  • Loading branch information
chris-twiner committed Jan 10, 2024
1 parent c72d2e1 commit 252091f
Show file tree
Hide file tree
Showing 7 changed files with 215 additions and 173 deletions.
Expand Up @@ -273,7 +273,7 @@ object AsyncParser {
def step(s: Input[DataChunk]): ResumableIter[DataChunk, F, EphemeralStream[PullType]] =
iterateeT(Monad[F].point(
s(el = e => {
//println("Did get a large chunk "+e)
//println("Did get a large chunk "+new String(e.array, e.offset, e.length, "UTF-8"))
val r = parser.nextInput(e)
r( el = es => {
//println("got el with es " + es.isEmpty + " feeder " + parser.feeder.needMoreInput)
Expand Down
28 changes: 14 additions & 14 deletions aalto/src/test/scala/scales/utils/io/RandomChannel.scala
Expand Up @@ -35,26 +35,26 @@ abstract class BaseRandomChannelWrapper(bufSize: Int) extends java.nio.channels.
if (cur0 > next0) {
count0 += 1
if (count0 > 10) { // feed 10 in
next0 = zeros.next
cur0 = 0
count0 = 0
//println("********* zeroed 10 times")
next0 = zeros.next
cur0 = 0
count0 = 0
//println("********* zeroed 10 times")
}
0
} else {
val red = {
val t = rand.nextInt(bufSize)
if (t == 0) {
_zeroed += 1
0
} else t
val t = rand.nextInt(bufSize)
if (t == 0) {
_zeroed += 1
0
} else t
}
if (red != 0) {
val did = fillBuffer(ourbuf, red)
if (did > -1) {
buf.put(ourbuf, 0, did)
}
did
val did = fillBuffer(ourbuf, red)
if (did > -1) {
buf.put(ourbuf, 0, did)
}
did
} else red
}
}
Expand Down

0 comments on commit 252091f

Please sign in to comment.