Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Fix single thread processing #39

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions lib/src/geojson.dart
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,22 @@ class GeoJson {
data: data, nameProperty: nameProperty, verbose: verbose, query: query);
final _feats = StreamController<GeoJsonFeature<dynamic>?>();
final _sub = _feats.stream.listen((f) {
print("FEAT SUB $f / ${f!.type}");
_pipeFeature(f, disableStream: disableStream);
if (verbose) {
print("FEAT SUB $f / ${f!.type}");
}

_pipeFeature(f!, disableStream: disableStream);
});
print("Processing");
if (verbose) {
print("Processing");
}
_processFeatures(dataToProcess: dataToProcess, sink: _feats.sink);
print("Closing");
if (verbose) {
print("Closing");
}

await _feats.close();
await _sub.cancel();
unawaited(_feats.close());
}

Future<void> _parse(
Expand Down Expand Up @@ -547,7 +555,9 @@ class GeoJson {
if (iso != null) {
iso.send(feature);
} else {
print("FEAT SINK $feature / ${feature?.type}");
if (verbose) {
print("FEAT SINK $feature / ${feature?.type}");
}
sink?.add(feature);
}
if (verbose == true) {
Expand Down