CommunicationApi constructor
CommunicationApi(})
Creates a CommunicationApi with the given executor and plugin id.
Whether this api isMaster and its privacy declaration must also be provided.
Implementation
CommunicationApi(this.executor, this.id, this.isMaster, this.declaration,
{this.statePath,
StorageMapper Function() mapper = defaultStorageMapper,
this.autoAcceptRegistration = true,
this.ignoreMessageSignature = false}) {
_communicator = GeigerCommunicator(this);
if (isMaster) {
storage = GenericController(id, mapper());
registerListener(
[MessageType.storageEvent], StorageEventHandler(this, storage));
} else {
final controller = storage = PassthroughController(this);
registerListener([MessageType.storageEvent], controller);
}
}