看看源码~
private static void Run(this TimerComponent self, TimerAction timerAction)
{
switch (timerAction.TimerClass)
{
case TimerClass.OnceTimer:
{
int type = timerAction.Type;
ITimer timer = self.timerActions[type];
if (timer == null)
{
Log.Error($"not found timer action: {type}");
return;
}
timer.Handle(timerAction.Object);
break;
}
case TimerClass.OnceWaitTimer:
{
ETTask<bool> tcs = timerAction.Object as ETTask<bool>;
self.Remove(timerAction.Id);
tcs.SetResult(true);
break;
}