bci_essentials.io.messenger

 1from abc import ABC, abstractmethod
 2
 3from ..classification.generic_classifier import Prediction
 4
 5
 6class Messenger(ABC):
 7    """A Messenger object is used by bci_controller to send event messages.  For example,
 8    to acknowledge that a marker has been received, or to provide a prediction.
 9    """
10
11    @abstractmethod
12    def ping(self):
13        """Indicate that sender is alive"""
14        pass
15
16    @abstractmethod
17    def marker_received(self, marker):
18        """Acknowledge that a marker was processed"""
19        pass
20
21    @abstractmethod
22    def prediction(self, prediction: Prediction):
23        """Send latest prediction"""
24        pass
class Messenger(abc.ABC):
 7class Messenger(ABC):
 8    """A Messenger object is used by bci_controller to send event messages.  For example,
 9    to acknowledge that a marker has been received, or to provide a prediction.
10    """
11
12    @abstractmethod
13    def ping(self):
14        """Indicate that sender is alive"""
15        pass
16
17    @abstractmethod
18    def marker_received(self, marker):
19        """Acknowledge that a marker was processed"""
20        pass
21
22    @abstractmethod
23    def prediction(self, prediction: Prediction):
24        """Send latest prediction"""
25        pass

A Messenger object is used by bci_controller to send event messages. For example, to acknowledge that a marker has been received, or to provide a prediction.

@abstractmethod
def ping(self):
12    @abstractmethod
13    def ping(self):
14        """Indicate that sender is alive"""
15        pass

Indicate that sender is alive

@abstractmethod
def marker_received(self, marker):
17    @abstractmethod
18    def marker_received(self, marker):
19        """Acknowledge that a marker was processed"""
20        pass

Acknowledge that a marker was processed

@abstractmethod
def prediction( self, prediction: bci_essentials.classification.generic_classifier.Prediction):
22    @abstractmethod
23    def prediction(self, prediction: Prediction):
24        """Send latest prediction"""
25        pass

Send latest prediction