> On Mar 15, 2021, at 1:18 AM, Chris Withers <ch...@withers.org> wrote:
> 
> On 09/03/2021 18:53, Glyph wrote:
>>> On Mar 9, 2021, at 3:18 AM, Chris Withers <ch...@withers.org 
>>> <mailto:ch...@withers.org>> wrote:
>>> 
>>> I'm not sure we're quite on the same page: I'm not looking to inspect the 
>>> state, but more be notified when certain edges are traversed.
>> The way you get notified when an edge is traversed is you add an output to 
>> that edge :).
> 
> Right, but as best I can tell, outputs in automat have to be defined as part 
> of the state machine class, I need targets only available after class 
> instantiation to be notified.

Outputs are just methods, so it sort of depends what you mean by "after class 
instantiation".  You can call whatever you want in an output.

>> Again... have outputs.  I think there's something you're leaving out about 
>> how you want to have some /generalized/ output, but without knowing a bit 
>> more it's hard to say how it could help more :).
> 
> I think it's what I said above. TBH, I'm probably going to end up writing 
> "yet another state machine class" that does just what I need, but I think 
> that's okay - not everything has to work for every situation :-)

It sounds like what you might want here is soemthing for constructing arbitrary 
machines at runtime, and automat is all about enforcing that your machine is 
static so that (for example) it can be visualized statically.  So yeah in that 
case, different library.

-g
_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to