Cancelation

class dsviper.Cancelation

Bases: object

A cancellation flag. Nothing is interrupted.

cancel() sets it; a running operation reads requested() at points of its own choosing and returns early. One that never reads it runs to the end.

Shared between a host signal handler and a server loop.

cancel() → None

Request a cancellation.

Safe to call from a signal handler: it sets one atomic flag.

requested() → bool

Return True once a cancellation has been requested - it stays true, there is no reset.