Protocols can use the serviceHub lazily in their constructors

This commit is contained in:
Shams Asari
2016-06-16 16:00:13 +01:00
parent cb1b274d5c
commit 7f3458803c
4 changed files with 45 additions and 28 deletions

View File

@ -31,7 +31,11 @@ abstract class ProtocolLogic<T> {
/** This is where you should log things to. */
val logger: Logger get() = psm.logger
/** Provides access to big, heavy classes that may be reconstructed from time to time, e.g. across restarts */
/**
* Provides access to big, heavy classes that may be reconstructed from time to time, e.g. across restarts. It is
* only available once the protocol has started, which means it cannnot be accessed in the constructor. Either
* access this lazily or from inside [call].
*/
val serviceHub: ServiceHub get() = psm.serviceHub
// Kotlin helpers that allow the use of generic types.