mirror of
https://github.com/copyrighttxt/watrbx-game-engine.git
synced 2026-09-06 05:37:48 +00:00
GEEKING
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using Microsoft.Ccr.Core;
|
||||
|
||||
namespace Roblox
|
||||
{
|
||||
public class Interleaver
|
||||
{
|
||||
readonly Port<Action> exclusive = new Port<Action>();
|
||||
readonly Port<Action> concurrent = new Port<Action>();
|
||||
|
||||
public void DoExclusive(Action action)
|
||||
{
|
||||
exclusive.Post(action);
|
||||
}
|
||||
|
||||
public void DoConcurrent(Action action)
|
||||
{
|
||||
concurrent.Post(action);
|
||||
}
|
||||
|
||||
public Interleaver()
|
||||
{
|
||||
CcrService.Singleton.Activate(Arbiter.Interleave(
|
||||
new TeardownReceiverGroup(),
|
||||
new ExclusiveReceiverGroup(
|
||||
Arbiter.Receive(true, exclusive, action => action())
|
||||
),
|
||||
new ConcurrentReceiverGroup(
|
||||
Arbiter.Receive(true, concurrent, action => action())
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user