Skip to content
pubscout

bazel_worker

1.1.5, released 12 months ago by tools.dart.dev

Protocol and utilities to implement or invoke persistent Bazel workers

$ flutter pub add bazel_worker
Source repository

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.

  • flutter_flavorizr

    A utility to easily create and configure application flavors in Flutter.

  • buffer

    Utilities and classes for reading and writing byte buffers and binary data streams.

Works with

Packages commonly used together with bazel_worker: ones it builds on, ones built on it, and its own family.