bazel_worker
1.1.5, released 12 months ago by tools.dart.dev
Protocol and utilities to implement or invoke persistent Bazel workers
What it does
Provides abstract classes for synchronous and asynchronous worker loops, generated protobuf messages, and testing helpers for building Bazel worker processes in Dart.
AI-written summary of version 1.1.5, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to write a Bazel worker in Dart
- You want to test worker logic locally
- You need a lightweight, no‑extra‑dependency worker framework
Skip it when
- You are building a UI widget library
- You need a high‑level networking client
Strengths
- Simple API with clear sync/async separation
- Built‑in protobuf support and generated messages
- Includes testing utilities for unit tests
Weaknesses
- Only supports Bazel workers, not general IPC
- Requires protobuf dependency
- No code generation beyond protobuf
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
Add dependency, import package, extend AsyncWorkerLoop or SyncWorkerLoop
import 'dart:io';
import 'package:bazel_worker/bazel_worker.dart';
void main() {
SyncSimpleWorker().run();
}
class SyncSimpleWorker extends SyncWorkerLoop {
WorkResponse performRequest(WorkRequest request) {
File('hello.txt').writeAsStringSync('hello world!');
return WorkResponse()..exitCode = EXIT_CODE_OK;
}
}Alternatives
Packages that do the same job and could replace bazel_worker.
- gtk
GTK utilities for Flutter Linux applications, providing settings and application lifecycle helpers.
76Compare - flutter_flavorizr
A utility to easily create and configure application flavors in Flutter.
86Compare - buffer
Utilities and classes for reading and writing byte buffers and binary data streams.
50Compare
Works with
Packages commonly used together with bazel_worker: ones it builds on, ones built on it, and its own family.
- asyncbazel_worker depends on itUtility classes and helpers that extend Dart's async library.
- protobufbazel_worker depends on itProvides runtime support for Dart protocol buffer messages generated by protoc_plugin.
- build_web_compilersBuilt on bazel_workerBuild_runner builder that compiles Dart to JavaScript or WebAssembly for web applications