finish message serialization of progress meters
Any given transfer can only display 1 progress meter at a time, or so this code assumes. In some cases, there are progress meters for different stages of a transfer, perhaps, and that is supported by this. This commit was sponsored by Ethan Aubin.
This commit is contained in:
parent
4efecaebd6
commit
31e417f351
7 changed files with 91 additions and 33 deletions
|
@ -9,6 +9,7 @@ module Types.Messages where
|
|||
|
||||
import qualified Utility.Aeson as Aeson
|
||||
import Utility.Metered
|
||||
import Utility.FileSize
|
||||
|
||||
import Control.Concurrent
|
||||
import System.Console.Regions (ConsoleRegion)
|
||||
|
@ -66,7 +67,9 @@ newMessageState = do
|
|||
data SerializedOutput
|
||||
= OutputMessage S.ByteString
|
||||
| OutputError String
|
||||
| ProgressMeter (Maybe Integer) MeterState MeterState
|
||||
| StartProgressMeter (Maybe FileSize)
|
||||
| UpdateProgressMeter BytesProcessed
|
||||
| EndProgressMeter
|
||||
| JSONObject L.ByteString
|
||||
-- ^ This is always sent, it's up to the consumer to decide if it
|
||||
-- wants to display JSON, or human-readable messages.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue