Last change
on this file was 100, checked in by ruud, 21 months ago |
python installs also wheel to avoid error messages
|
File size:
1.4 KB
|
Rev | Line | |
---|
[100] | 1 | from abc import ABC, abstractmethod
|
---|
| 2 | from typing import TypeVar, Generic
|
---|
| 3 |
|
---|
| 4 | from geniusweb.connection.ConnectionEnd import ConnectionEnd
|
---|
| 5 | from geniusweb.references.Reference import Reference
|
---|
| 6 |
|
---|
| 7 |
|
---|
| 8 | INTYPE = TypeVar('INTYPE')
|
---|
| 9 | OUTTYPE = TypeVar('OUTTYPE')
|
---|
| 10 |
|
---|
| 11 | class ConnectionFactory(ABC, Generic[INTYPE,OUTTYPE]):
|
---|
| 12 | '''
|
---|
| 13 | factory that can turn a {@link Reference} into a connection to that
|
---|
| 14 | reference.
|
---|
| 15 |
|
---|
| 16 |
|
---|
| 17 | @param <INTYPE> the type of incoming messages. Incoming messages are
|
---|
| 18 | received through Listener#not. Incoming messages are usually
|
---|
| 19 | asynchronous.
|
---|
| 20 | @param <OUTTYPE> the type of outgoing messages. Outgoing messages can be sent
|
---|
| 21 | directly with #send.
|
---|
| 22 | '''
|
---|
| 23 | @abstractmethod
|
---|
| 24 | def connect(self, reference:Reference) -> ConnectionEnd[INTYPE, OUTTYPE]:
|
---|
| 25 | '''
|
---|
| 26 | @param reference the {@link Reference} to a {@link Connectable}
|
---|
| 27 | @return connection to provided reference
|
---|
| 28 | @throws ConnectionError if the connection can not be made because
|
---|
| 29 | of a network or address related problem.
|
---|
| 30 | This points to something non-trivially
|
---|
| 31 | that may require user intervention to fix
|
---|
| 32 | something.
|
---|
| 33 | @throws NoResourcesNowException if the connection can not be made at this
|
---|
| 34 | moment because of lack of resources on
|
---|
| 35 | the server. This suggest to retry later.
|
---|
| 36 | '''
|
---|
Note:
See
TracBrowser
for help on using the repository browser.