source: geniuswebcore/geniusweb/connection/Connectable.py@ 84

Last change on this file since 84 was 84, checked in by Bart Vastenhouw, 3 years ago

Added time-dependent parties for python and simpleRunner-GUI for java

File size: 904 bytes
Line 
1from abc import ABC, abstractmethod
2from typing import TypeVar, Generic, List
3
4from geniusweb.connection.ConnectionEnd import ConnectionEnd
5
6INTYPE = TypeVar('INTYPE')
7OUTTYPE = TypeVar('OUTTYPE')
8
9class Connectable(ABC, Generic[INTYPE,OUTTYPE]):
10 '''
11 A Connectable is an object that can connect on request with a provided
12 {@link ConnectionEnd} and then respond to incoming and outgong signals.
13 @param <INTYPE> the type of incoming messages
14 @param <OUTTYPE> the type of outgoing messages
15 '''
16
17 @abstractmethod
18 def connect(self,connection:ConnectionEnd[INTYPE, OUTTYPE] ):
19 '''
20 creates the connection. Only called if not yet connected.
21 @param connection the new connection
22 '''
23
24 @abstractmethod
25 def disconnect(self):
26 '''
27 Removes the connection from a connectable; the previously given
28 connection can not be used anymore after this call. Only called if
29 previously connected.
30
31 '''
Note: See TracBrowser for help on using the repository browser.