How can I cancel a schedule in iFiber??

Options
locus84
edited September 2013 in Photon Server
In Loadbalancing project.

In Game.cs

I really love to use ExecutionFiber for all Timer functions.

So I have a dictionary of <int, IDisposable> and use them as a set of scheduled actions.

When I schedule action, I add a new IDisposable with it's hashId as a key.

Of course in the action, I remove the IDispoable from the dictionary and dispose it.

And then if a cancel schedule operation has come. I find it from dictionary and do the same.

I mean I remove the IDispoable from the dictionary and dispose it.

But it seams like this model is not working as a schedule manager.

I cant get my action functions running.

I wonder whether i'm dealing with Ifiber properly

Thx for the help in advance!

Comments

  • chvetsov
    Options
    hi, locus84.

    Yes, you do it right. When you call Dispose scheduled action are canceled.
    you could check implementation details here
    https://code.google.com/p/retlang/sourc ... rAction.cs
  • Thank you chvetsov!

    Yeah of course, I've checked that.

    There were some confusions between TimeSpan and DateTime Calculation.

    Now I see my fibers working fine :D GOOOOOOOOOOOOOOOOOOOOOOOOOOOD!

    BTW, is it big deal to have a poolfiber per clientPeer for the server performance??

    For now, I'm using ApplicationStat class' poolfiber for handling my peer's estimated timeout actions Like

    DisconnectAfterTime(long timeMS), SendAuthFaild_DisconnectAfterTime(long timeMS);
  • chvetsov
    Options
    >> BTW, is it big deal to have a poolfiber per clientPeer for the server performance??
    you have it already PeerBase.RequestFiber. you may use it for your own tasks.