if (ip is None) and (not self.scheduler_port) and (not self.processes):
// Use inproc transport for optimization
scheduler_address = "inproc://"
elif ip is not None and ip.startswith("tls://"):
scheduler_address = ("%s:%d" % (ip, self.scheduler_port))
else:
if ip is None:
ip = "127.0.0.1"
scheduler_address = (ip, self.scheduler_port)
self.scheduler.start(scheduler_address)
yield [self._start_worker(**self.worker_kwargs) for i in range(n_workers)]