Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.10/site-packages/jupyter_client/channelsabc.py: 71%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

24 statements  

1"""Abstract base classes for kernel client channels""" 

2# Copyright (c) Jupyter Development Team. 

3# Distributed under the terms of the Modified BSD License. 

4import abc 

5 

6 

7class ChannelABC(metaclass=abc.ABCMeta): 

8 """A base class for all channel ABCs.""" 

9 

10 @abc.abstractmethod 

11 def start(self) -> None: 

12 """Start the channel.""" 

13 pass 

14 

15 @abc.abstractmethod 

16 def stop(self) -> None: 

17 """Stop the channel.""" 

18 pass 

19 

20 @abc.abstractmethod 

21 def is_alive(self) -> bool: 

22 """Test whether the channel is alive.""" 

23 pass 

24 

25 

26class HBChannelABC(ChannelABC): 

27 """HBChannel ABC. 

28 

29 The docstrings for this class can be found in the base implementation: 

30 

31 `jupyter_client.channels.HBChannel` 

32 """ 

33 

34 @abc.abstractproperty 

35 def time_to_dead(self) -> float: 

36 pass 

37 

38 @abc.abstractmethod 

39 def pause(self) -> None: 

40 """Pause the heartbeat channel.""" 

41 pass 

42 

43 @abc.abstractmethod 

44 def unpause(self) -> None: 

45 """Unpause the heartbeat channel.""" 

46 pass 

47 

48 @abc.abstractmethod 

49 def is_beating(self) -> bool: 

50 """Test whether the channel is beating.""" 

51 pass