isolate_agents
에이전트는 백그라운드 고립 상태에 있는 상태입니다.
간편하게 고립, 포트 및 상태를 래핑하는 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 ↗