From a23bd9b34de890a254604c809b70a8c13a711bdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Drvo=C5=A1t=C4=9Bp?= Date: Thu, 29 Jun 2023 10:44:12 +0200 Subject: [PATCH 1/2] Allow arbitrary results in ParsedPayload --- src/payload.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/payload.jl b/src/payload.jl index b1f6857..6c4ac39 100644 --- a/src/payload.jl +++ b/src/payload.jl @@ -3,7 +3,7 @@ # # What we send to the consume! method -struct ParsedPayload{B<:AbstractResultBuffer, C<:AbstractParsingContext} +struct ParsedPayload{B, C<:AbstractParsingContext} row_num::Int len::Int results::B From 38928f3a2f247055972be5e7da7a0db27ff0b443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Drvo=C5=A1t=C4=9Bp?= Date: Thu, 29 Jun 2023 10:44:30 +0200 Subject: [PATCH 2/2] Only wake up lexer when we're done parsing --- src/TaskCounters.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TaskCounters.jl b/src/TaskCounters.jl index 0faed44..0ca2af6 100644 --- a/src/TaskCounters.jl +++ b/src/TaskCounters.jl @@ -26,7 +26,7 @@ function dec!(t::TaskCounter, n::Int=1) Base.@lock t begin @assert t.n >= n "Trying decrement a `TaskCounter` past zero, `$(t.n)` -> `$(t.n - n)`" t.n -= n - notify(t.cond) + (t.n == 0) && notify(t.cond) end return nothing end