Pakete, Repositories und App-Kategorien suchen

GitHub-Repositorygaaclarke/agents

Agenten

Dart-Paket, das einen Isolat, Ports und Zustand bequem umschließt, um Isolate einfach zu nutzen.

Projektcover von Agenten
Sterne
85
Forks
6
Letzter Push (UTC)
23.06.2024
Projektstatus
Aktiv

Original-README

Englischer Projektschnappschuss. Aktuelle Inhalte auf GitHub.

Isolate Agents

Description

Isolate Agents adds a new class, Agent, which is a proper implementation of the Actor model for Dart. Where Isolates have no mechanism for communication, Agents do. It is inspired by Clojure's agents.

Example usage

import 'package:isolate_agents/isolate_agents.dart';

void main() async {
  Agent<int> agent = await Agent.create(() => 1);
  // The following add operation is executed in the Agent's isolate.
  agent.update((int x) => x + 1);
  assert(2 == await agent.exit());
}

Why?

After writing Dart code for a couple of years I realized I was writing the same code over and over again in order to be able to use Isolates. Isolates don't fully implement the Actor model so a handshake of SendPort and a protocol needs to be devised for each non-trivial usage of Isolates. Agents factor all that logic into a reusable package, eliminating the SendPort handshake and standardizing the protocol.

gaaclarke GitHub avatar
GitHub-Autor

gaaclarke ↗

Seattle, WA
SprachenDart

Von diesem Repository veröffentlichte Pakete

Verwendete Abhängigkeiten

Abhängigkeiten 2 Einträge

Wie wähle ich ein passendes Repository?

Nach Anwendungsfall filtern, Aktivität vergleichen und vor der Nutzung das Originalprojekt prüfen.

  1. Nach Name, Autor oder Beschreibung suchen und nach Thema eingrenzen.
  2. Sterne, Forks und letzte Pushes vergleichen. Sterne zeigen Interesse, garantieren aber keine Qualität.
  3. Vor der Nutzung README, Lizenz und Issues auf GitHub prüfen.

Quellen und Pflege

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗