squadron_builder 6.1.1 copy "squadron_builder: ^6.1.1" to clipboard
squadron_builder: ^6.1.1 copied to clipboard

Dart code generator for Squadron workers. Implement your worker service and let squadron_builder bridge the gap with Web Workers and Isolates!

Squadron logo

Squadron - Multithreading and worker pools in Dart #

Offload CPU-bound and long running tasks and give your mobile and Web apps some air!

squadron_builder #

Dart code generator for Squadron workers. Implement your worker service and let squadron_builder bridge the gap with Web Workers and Isolates!

Pub Package Dart Platforms Flutter Platforms

License Null Safety Dart Style Pub Points Likes Popularity Last Commit

Usage #

squadron_builder is a companion package to Squadron and is intended to be installed as a development dependency to your project.

Its purpose is to generate the code for Workers and WorkerPools based on the service classes you want to run in dedicated threads.

Example of a service class:

// this annotation tells squadron_builder that this class contains code to be executed on dedicated threads
@SquadronService(baseUrl: '~/workers', targetPlatform: TargetPlatform.vm | TargetPlatform.web)
base class HelloWorld {
  // this annotation tells squadron_builder that this method is exposed to clients running in the main thread for instance
  @SquadronMethod()
  FutureOr<String> hello([String? name]) {
    name = name?.trim() ?? 'World';
    return 'Hello, $name!';
  }
}
20
likes
160
pub points
81%
popularity

Publisher

unverified uploader

Dart code generator for Squadron workers. Implement your worker service and let squadron_builder bridge the gap with Web Workers and Isolates!

Repository (GitHub)
View/report issues

Topics

#codegen #concurrency #isolate #multithread #web-worker

Documentation

API reference

Funding

Consider supporting this project:

github.com

License

MIT (license)

Dependencies

analyzer, build, meta, source_gen, squadron

More

Packages that depend on squadron_builder