SFClient constructor

SFClient({
  1. required Host host,
  2. required SFClientConfig config,
  3. PubSub? pubsub,
  4. PayloadEncryptor? encryptor,
})

Implementation

SFClient({
  required this.host,
  required this.config,
  this.pubsub,
  this.encryptor,
}) {
  if (!config.isValid()) {
    throw ArgumentError('Invalid client configuration');
  }

  _serverSelector = ServerSelector(host: host);
  _messageSender = MessageSender(
    host: host,
    config: config,
    serverSelector: _serverSelector,
  );
  _mailboxManager = MailboxManager(
    host: host,
    config: config,
  );
}