Files
TelemetryMonitor/lib/decoder/decoder_base.dart
2026-04-21 14:40:09 -03:00

19 lines
632 B
Dart

import 'dart:async';
import 'dart:typed_data';
import '../proto/messages.pb.dart';
/// Abstract decoder interface. Feeds raw frames in, emits envelopes out.
///
/// On native, the implementation runs in an isolate and batches envelopes.
/// On Web, the implementation decodes synchronously in [feed].
abstract class Decoder {
/// Stream of decoded envelopes (or batches thereof, flattened to per-envelope).
Stream<Envelope> get envelopes;
/// Push a raw frame for decoding. Returns immediately.
void feed(Uint8List frame);
/// Tear down. Stops the isolate (on native) and closes the stream.
Future<void> dispose();
}