zeroc-ice/ice-demos

Counter demo on Python

Closed this issue · 4 comments

Hello! Is it possible to add/do this c++ example on Python? If is it possible how?

Did you check the python IceStorm demo?

yes but it does not use any mutex or Ice::uncheckedCast on it 😿

The Python hello demo shows the use of ucheckedCast

oneway = Demo.HelloPrx.uncheckedCast(twoway.ice_oneway())
batchOneway = Demo.HelloPrx.uncheckedCast(twoway.ice_batchOneway())
datagram = Demo.HelloPrx.uncheckedCast(twoway.ice_datagram())
batchDatagram = Demo.HelloPrx.uncheckedCast(twoway.ice_batchDatagram())

As per mutex usage, this is a C++ standard API not Ice specific, python has its own APIs for this

see for example:
https://docs.python.org/3/library/threading.html#lock-objects
https://docs.python.org/3/library/threading.html#condition-objects

Some of the demos in https://github.com/zeroc-ice/ice-demos/tree/3.7/python/Ice make use of these python APIs too

Thank you so much gentleman!