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
0
votes
1 answer

How to create three infinity loop inside isolate?

I am learning Dart and working with Isolate. I wrote next code, and expected that it will create three isolate process that will work infinity: main() { Isolate.spawn(echo, "Hello"); Isolate.spawn(echo, "Hello2"); Isolate.spawn(echo,…
Dmitry Bubnenkov
  • 9,415
  • 19
  • 85
  • 145
0
votes
1 answer

Flutter Dart - Calling sqflite function in Isolate causes error

I have a sqflite database that works, unit tests work. I want to call a sqflite method in onTap method. I understand I cannot execute the sqflite function in the main UI thread (Flutter tells me that at runtime). So I created an Isolate to call the…
ezaspi
  • 684
  • 7
  • 25
0
votes
1 answer

Dart Isolate SendPort and ReceivePort sending 100times vice versa

My main works, but in my foo I would like to send data to main. Here's my code where I want to pass data between foo and main 100 times. How can I achieve that? import 'dart:isolate'; import 'dart:async'; void foo(SendPort sendPort) async { …
0
votes
1 answer

Android Alarm Manager callback doesn't work

Im trying to use plugin Android Alarm Manager for timer and code execution in background, but cant really get it working right. If i set something like "print("v")" as a callback - everything works fine, but when Im trying to do something extra, it…
Ruslan
  • 433
  • 1
  • 4
  • 7
0
votes
1 answer

Dart: Using JsObject and window API in an isolate

I am having some difficulties making use of isolates in Dart. The first problem is I wanted to use dart:js to use a javascript library in one of my isolates. I tried with the following code: void runCode(SendPort sendPort) { print("still…
SSS
  • 761
  • 2
  • 9
  • 19
0
votes
1 answer

Worker package disfunction when importing postgresql package

I'm trying to use the Worker package and the PostgreSQL package. I'm not sure why but if I run the example in https://diegorochablog.wordpress.com/2014/02/18/worker-dart-concurrent-programming-does-not-have-to-be-hard/ After changing nothing but…
Alon Amir
  • 4,913
  • 9
  • 47
  • 86
0
votes
0 answers

Loading HTML in the current dom and execute a loaded script

In javascript I created a loader for a wizard. I talk about a single page with a wizard section. Every (new) sequence state of the page loads a HTML section from the server into the wizard dom section of the page and executes a script. The script…
voscausa
  • 11,253
  • 2
  • 39
  • 67
0
votes
1 answer

How should i use Dart Isolate unhandledExceptionCallback?

I'm trying to use Isolates in my Dart webapp but i can't seem to make the error callback argument work. I have a very basic code which is being run in Dartium. import "dart:isolate"; void main() { print("Main."); spawnFunction(test,…
NagyI
  • 5,907
  • 8
  • 55
  • 83
0
votes
1 answer

Dart server check at intervals

I'm trying to run 'checkServer' at 5 second intervals. However 'server is fine' only runs once. What needs to be done to repeat the function? import 'dart:io'; import 'dart:uri'; import 'dart:isolate'; checkServer() { HttpClient client = new…
basheps
  • 10,034
  • 11
  • 36
  • 45
-1
votes
1 answer

How to add periodic task in compute function of dart?

I want to send log to server periodically after 30 sec. For performance i want to use different thread by using compute function. But Timer is not working in compute. Any suggestions to do task in different threads periodically in flutter?
user3066829
  • 157
  • 1
  • 1
  • 12
-1
votes
1 answer

Multithreading for MultiMethods in Flutter

may i ask how to multithreading some functions in dart for example i have 16 Future functions i want first to execute this function in the first thread await GetRoot(); //Future then after the first thread end i want to execute theses…
test firma
  • 171
  • 1
  • 1
  • 6
1 2 3
19
20