Summary
I wanted to ask whether true bidirectional streaming with a persistent isolate is in scope for this package,
or part of any future roadmap.
My concrete use case is a persistent WebSocket-style workflow:
- keep message handling/state syncing/parsing logic inside a long-lived isolate or worker
- let the main isolate send outbound events/control messages to it at any time
- let the isolate/worker continuously emit processed/parsed data back to the main isolate
- avoid tying this communication to a single
compute() request/response lifecycle
In other words, I am looking for a persistent channel where both sides can send messages independently.
Why I am asking here
I found packages such as stream_isolate and typed_isolate that cover similar bidirectional isolate
communication on native Dart/Flutter platforms.
The reason I am asking here is that isolate_manager already has a broader cross-platform story around VM
isolates, Web Workers, and WASM. So I wanted to understand whether a stream-first bidirectional API fits this
package’s scope.
Current model
From reading the package, IsolateManager currently seems centered around a task queue model:
final result = await isolate.compute(input);
createCustom supports multiple outputs during a task through controller.sendResult() and callback, which is
useful for progress/result streaming. But the lifecycle still appears tied to an active compute() call and
final callback completion.
For my use case, the desired shape is closer to a persistent channel/actor model:
final bridge = await IsolateBridge.spawn<Input, Output>(worker);
bridge.output.listen((event) {
// processed/parsed data from worker -> main
});
bridge.send(input); // outbound event/control message main -> worker
bridge.pipe(inputStream); // optional Stream<Input> -> worker
Inside the worker:
void worker(bridge) {
final socket = /* persistent websocket or socket-like source */;
bridge.input.listen((message) {
// main -> worker control/outbound event
// update state, send over socket, etc.
});
socket.listen((rawMessage) {
final parsed = parseAndApplyState(rawMessage);
bridge.send(parsed); // worker -> main processed data
});
}
Question
Is this kind of bidirectional streaming / persistent channel API something you would consider in scope for isolate_manager?
If yes, I would be interested in discussing a possible design before attempting an implementation.
If not, that is also totally fine, I can treat it as a separate abstraction built specifically around stream-to-stream isolate communication.
Summary
I wanted to ask whether true bidirectional streaming with a persistent isolate is in scope for this package,
or part of any future roadmap.
My concrete use case is a persistent WebSocket-style workflow:
compute()request/response lifecycleIn other words, I am looking for a persistent channel where both sides can send messages independently.
Why I am asking here
I found packages such as
stream_isolateandtyped_isolatethat cover similar bidirectional isolatecommunication on native Dart/Flutter platforms.
The reason I am asking here is that
isolate_manageralready has a broader cross-platform story around VMisolates, Web Workers, and WASM. So I wanted to understand whether a stream-first bidirectional API fits this
package’s scope.
Current model
From reading the package,
IsolateManagercurrently seems centered around a task queue model:createCustom supports multiple outputs during a task through controller.sendResult() and callback, which is
useful for progress/result streaming. But the lifecycle still appears tied to an active compute() call and
final callback completion.
For my use case, the desired shape is closer to a persistent channel/actor model:
Inside the worker:
Question
Is this kind of bidirectional streaming / persistent channel API something you would consider in scope for isolate_manager?
If yes, I would be interested in discussing a possible design before attempting an implementation.
If not, that is also totally fine, I can treat it as a separate abstraction built specifically around stream-to-stream isolate communication.