Hello !
Thanks Grant ! Initially, I have had problems to understand the usage of stateless, especially,
everything is async for me.
I am usually do my state-thinking-defining in powerpoint. Such a process make the things
more clear to yourself [I saw the visual statedesigner for stateless on codeplex, but it's
currently not that powerful].
Yesterday, I made a big session in VS and found the reason: I am calling FIRE in the
OnEntry methods, so I am processing everythingrecursively until the final stage is reached.
Luckily, the states are right and have a FINITE state ;-)
[Otherwise, I would have had an endless recursion ;-) ]
The problem is, that I do not have a separate thread to process. The app manages
the connections so hundreds of computers in a resource save manner. The App
loops over a list of computer objects and call their init method. In that init method,
the computers stateengine will be initialized and the stateengines init method will
be called on a separate therad, which calls OnEntry, fire, onEntry, fire ...
The background is, that I have a ProducerConsumer model with a small reserved
number of threads. What I reworked now is, to span a new workitem to one of the
threads and that will call the work method of the stateengine. This may change
state, but put the work method back onto the ProducerConsumer pool. The bad
thing now is, that I have a switch/case block in the work method deciding on the
current state. This is a little unexpected [I made statemachines until now with
one concrete class per state]. But now, this works well !
I had an initial help call here, becuase I don't understand and the phone demo
is just too simple ;-)
Thanks for the help!
Best regards,
++mabra