Closed techouse closed 1 year ago
I saw now that you have to configure it in build.yaml
.
Yep, just hoping that List
is lighter/easier to transfer across Isolates and Web workers...
BTW thanks for providing an example integrating Squadron with Chopper. I see the example uses Squadron to deserialize the response from the REST API. I was wondering if you've tried to wrap the whole Chopper client inside a Squadron worker? So that the whole REST call is handled off the main thread, i.e. request serialization / API call / response deserialization.
I was essentially trying to replicate what the Flutter docs suggest:
If you run the fetchPhotos() function on a slower device, you might notice the app freezes for a brief moment as it parses and converts the JSON. This is jank, and you want to get rid of it.
You can remove the jank by moving the parsing and conversion to a background isolate using the compute() function provided by Flutter. The compute() function runs expensive functions in a background isolate and returns the result. In this case, run the parsePhotos() function in the background.
I haven't tried putting the whole REST call into a Worker. I'm not sure what the benefit of that would be and it could get quite tricky when passing JWT tokens around, however, I'll take a look at it once I got a bit more free time :)
Don't bother, I was just being curious :-)
Hey 👋
I'm using squadron
5.0.0
with squadron_builder2.1.2
and get this error when compiling my app.