isolate_agents
エージェントはバックグラウンドのアイソレート上に存在する状態です。
Isolate、ポート、状態を簡単にラップするためのDartパッケージ。
以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。
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.
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());
}
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.
用途で絞り込み、開発状況を比較し、採用前に元のリポジトリで要件を確認しましょう。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗