knaeckeKami / diffutil.dart

Apache License 2.0
27 stars 4 forks source link

Option for computing in an isolate #23

Closed sagnik-sanyal closed 4 months ago

sagnik-sanyal commented 4 months ago

How to perform intensive calculations for diff util in an isolate ? @knaeckeKami

knaeckeKami commented 4 months ago

Use Isolate.run

sagnik-sanyal commented 4 months ago

The problem with this approach is it is throwing error cant send from SendPort.send, do you have any sample where you use isolate for calculating list diff using isolate ?

Here's the error : Unhandled Exception: Invalid argument(s): Illegal argument in isolate message: object is unsendable - Library:'dart:async' Class: _Future@4048458 (see restrictions listed at SendPort.send() documentation for more information)

knaeckeKami commented 4 months ago

you can't use Isolates if you have Futures, Streams, FileHandles, etc. in your List.