Active object: Difference between revisions

Content added Content deleted
m (removed note about differences from python version, i was mistaken when adding it)
(→‎{{header|Python}}: port to python 3 as python 2 is eol)
Line 2,487: Line 2,487:


=={{header|Python}}==
=={{header|Python}}==
{{works with|Python|3}}
Assignment is thread-safe in Python, so no extra locks are needed in this case.
Assignment is thread-safe in Python, so no extra locks are needed in this case.


Line 2,524: Line 2,525:
ai = Integrator(lambda t: sin(pi*t))
ai = Integrator(lambda t: sin(pi*t))
sleep(2)
sleep(2)
print ai.S
print(ai.S)
ai.K = lambda t: 0
ai.K = lambda t: 0
sleep(0.5)
sleep(0.5)
print ai.S</lang>
print(ai.S)</lang>


=={{header|Racket}}==
=={{header|Racket}}==