--

Isolate.run() is a lower-level API that allows you to create and manage isolates in Flutter. It takes a function as an argument and runs that function in a new isolate. Since it runs the function in a new isolate, there is no need to pass a SendPort for communication between the main isolate and the new isolate.

On the other hand, compute() is a higher-level API in Flutter that uses Isolate under the hood. It takes a function and its arguments as parameters and runs that function in a new isolate. It also automatically creates a SendPort for communication between the main isolate and the new isolate.

So, if you are using Isolate.run() directly, you do not need to worry about SendPort for communication. However, if you are using compute(), the SendPort is handled automatically for you.

--

--

Santhosh Adiga U
Santhosh Adiga U

Written by Santhosh Adiga U

Founder of Anakramy ., dedicated to creating innovative AI-driven cybersecurity solutions.

No responses yet