The pattern used in IceStorm/clock subscriber, isn't simple and also is not thread safe, there is a chance for exit call run when GDC global queue is still releasing the communicator reference in the signal event handler
For the publisher we do all the work in the main thread including the signal handling, but it is still not straightforward and will be good if we come up with a better solution
The pattern used in IceStorm/clock subscriber, isn't simple and also is not thread safe, there is a chance for exit call run when GDC global queue is still releasing the communicator reference in the signal event handler
https://github.com/zeroc-ice/ice-demos/blob/d3d8881d3e2351a6a196be29c16cd7aaaa4e63a0/swift/IceStorm/clock/Sources/Subscriber/main.swift#L41-L48
For the publisher we do all the work in the main thread including the signal handling, but it is still not straightforward and will be good if we come up with a better solution
https://github.com/zeroc-ice/ice-demos/blob/d3d8881d3e2351a6a196be29c16cd7aaaa4e63a0/swift/IceStorm/clock/Sources/Publisher/main.swift#L35-L45