getSubscribeChannel<T> method

Channel<T> getSubscribeChannel<T>(
  1. String moduleId,
  2. String channelId,
  3. T inst,
  4. ChannelCallback<T> callback,
)

Implementation

Channel<T> getSubscribeChannel<T>(
    String moduleId, String channelId, T inst, ChannelCallback<T> callback) {
  final mutator = _setupChannel<T>(moduleId, channelId, inst, false);
  final subChan = Channel<T>(moduleId, channelId, mutator, this, ChannelAccessRights.READ, callback);
  final modChanId = combineIds(moduleId, channelId);
  _receiverMap[modChanId] = subChan.onMessageReceived;
  print('Sub: $moduleId : $channelId ==> $inst');
  return subChan;
}