搜尋套件、儲存庫與 APP 分類

GitHub 儲存庫gaaclarke/agents

代理

一個方便封裝隔離區、埠和狀態的 Dart 套件,便於使用隔離區。

代理 專案封面
星標
85
分支
6
最近推送(UTC)
2024年6月23日
專案狀態
未封存

原始 README

以下為英文專案原文快照,最新內容請造訪 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 作者

gaaclarke ↗

Seattle, WA
語言Dart

此儲存庫發佈的套件

使用的依賴

依賴清單 2 項

  • lints開發依賴^2.0.0
  • test開發依賴^1.16.5

如何選擇適合專案的儲存庫?

先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。

  1. 透過儲存庫名稱、作者或描述搜尋,再依技術分類縮小範圍。
  2. 綜合星標、分支與最近推送比較專案;星標反映社群關注,不保證品質。
  3. 使用前在 GitHub 確認 README、授權條款與 Issues。

來源與維護

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

GitHub Docs — About repositories ↗