Coverage for melissa/types/__init__.py: 68%

19 statements  

« prev     ^ index     » next       coverage.py v7.6.12, created at 2025-03-10 22:25 +0100

1"""Interfaces for MixIn classes defined in server scripts.""" 

2 

3import threading 

4from typing import Protocol, Any, Union, List 

5 

6 

7class QueueProtocol(Protocol): 

8 not_empty: threading.Condition 

9 mutex: threading.RLock 

10 batch_size: int 

11 _is_reception_over: bool 

12 

13 def _get_with_eviction(self, index: Union[List[int], int]) -> Any: 

14 ... 

15 

16 def _get_without_eviction(self, index: Union[List[int], int]) -> Any: 

17 ... 

18 

19 def _is_sampling_ready(self) -> bool: 

20 ... 

21 

22 def _size(self) -> int: 

23 ... 

24 

25 def _get_from_index(self, index: Union[List, int]) -> Any: 

26 ... 

27 

28 def set_threshold(self, t: int) -> None: 

29 ...