在玩F#代理后,我尝试使用它们来减少地图.
我使用的基本结构是:
我想知道的问题是:
非常感谢,
type Agent<'T> = MailboxProcessor<'T>
//This is the response the supervisor
//gives to the worker request for work
type 'work SupervisorResponse =
| Work of 'work //a piece of work
| NoWork//no work left to do
//This is the message to the supervisor
type 'work WorkMsg =
| ToDo of 'work //piles up work in the Supervisor queue
| WorkReq of AsyncReplyChannel<SupervisorResponse<'work>> //'
//The supervisor agent can be interacted …Run Code Online (Sandbox Code Playgroud) 我正在使用MailboxProcessor类来保持独立的代理人做自己的事情.通常,代理可以在同一个进程中相互通信,但我希望代理在处于不同的进程或甚至不同的机器上时能够相互通信.什么样的机制最适合实现它们之间的通信?有一些标准的解决方案吗?
请注意,我正在使用Ubuntu实例来运行代理.