Questions tagged [dart-isolates]

In the Dart programming language, an Isolate is a single-threaded unit of concurrency.

In the Dart programming language, an Isolate is a single-threaded unit of concurrency. Communication with others Isolates is done via message passing.

Introduktion to Dart Isolate

dart:isolate library

296 questions
4
votes
2 answers

How to use results from different isolates in the main isolate?

I'm really new to Dart and also to programming. I'm trying to develop a a command-line program in Dart using isolates. My intention is to compare it's performance againt the same program, but written in Java with threads. The Dart program looks like…
jlggross
  • 41
  • 2
4
votes
1 answer

How to use multiple isolates to serve requests

How can a Dart server be set up to use all available cores for in coming requests (e.g. by using multiple isolates to serve requests)?
Benjamin
  • 275
  • 2
  • 8
4
votes
1 answer

Dart : Isolate not working when using html import

I found this very strange and unfortunate behavior in Dart. When I import 'dart:html' in my main file, my Isolate stops working. With my file "isolate.dart" : main(){ print('BAM'); } This prints "BAM": import 'dart:core'; import…
user3236471
4
votes
2 answers

Dart dynamic class loading

I want to build an application server with Dart. The httpServer in the dart:io library is certainly a good starting point for that. But I struggle with the task to "deploy" an application without restarting the server process. To be more precise: I…
Gregor
  • 2,917
  • 5
  • 28
  • 50
4
votes
1 answer

Difference between DART Isolate and Thread (Java,C#)

For me The DART Isolate looks like a Thread (Java/C#) with a different terminology. In which aspect Isolate differs from a Thread?
Rajkumar Vasan
  • 712
  • 1
  • 9
  • 22
4
votes
2 answers

Is it possible to pass command-line arguments to a new isolate from spawnUri()

When starting a new isolate with spawnUri(), is it possible to pass command line args into that new isolate? eg: Command line: dart.exe app.dart "Hello World" In app.dart #import("dart:isolate"); main() { var options = new Options(); …
Chris Buckett
  • 13,738
  • 5
  • 39
  • 46
3
votes
1 answer

Access variables in external scope when using isolation in Dart

In Isolates, I can refer to a local variable from an outer scope or a field variable of a class without passing it as a separate message. Is this implicitly copying the values into the new isolation's memory area? I'm curious about the…
kssce
  • 33
  • 4
3
votes
0 answers

FlutterFire Messaging : MissingPluginException error thrown for Shared Preferences

I'm using firebase and shared_preference in my flutter project, where I need to store a incoming message to the shared preferences. Whenever a message is received, I am getting the below exception I/flutter (29300): FlutterFire Messaging: An error…
3
votes
1 answer

Dart program not exiting

I'm having trouble tracking down why my dart program isn't terminating. I'm pretty sure it's something to do with either isolates, or stream controllers, and making sure they are closed, but I can't work out what the problem is. On all of my…
テッド
  • 776
  • 9
  • 21
3
votes
1 answer

Is Dart really a single-threaded programming language?

I'm very new to Dart and stilling learning it. As I understand, Dart executes code in different isolates. An isolate could start up another isolate to execute some long-running code. For each isolate, there is a thread and some memory allocated for…
Just a learner
  • 26,690
  • 50
  • 155
  • 234
3
votes
2 answers

In background flutter app works only for 1 minute after that it stops it's working, is Dart-Isolates good to try?

made a simple counter app with shake package to increment counter var by shaking phone, things works well when app is running in front (in active state) but opening other app stops this shake feature after one minute, it works only for one minute…
3
votes
1 answer

How to bring an app from background to foreground

I want to bring an app in the background to the foreground. This link use a package that is not working and although the author has done a tremendous job it has seen no updates for 11 months. So I am looking for a solution to bring the app in the…
Antonin GAVREL
  • 9,682
  • 8
  • 54
  • 81
3
votes
1 answer

Determine the type of error thrown by a function executed by compute

In code like the following, _decodeJson throws a FormatException. final invalidJsonString = '{"key":"this is "invalid value" ."}'; try { await compute( _decodeJson, invalidJsonString, ); } on FormatException catch (_)…
kiri
  • 31
  • 2
3
votes
2 answers

Dart how to pass generic function to isolate

Is there a way to pass a generic Function as Parameter to an Isolate at spawn? I have attached a simplifyed version of my code (not working) but is there a way to archive this without dynamics? Or is the Type of the functionToCall decided at runtime…
timoxd7
  • 125
  • 6
3
votes
0 answers

How to register Flutter application plugins with a separate FlutterEngine in iOS

So my flutter app's isolate function is waking up in the background due to iOS's delegate method didUpdateLocation getting called. I am able to see print logs on the flutter side when didUpdateLocation gets called, but I am getting a missing plugin…
Peter Irving
  • 305
  • 2
  • 10