def get_channel(self, name): key = _dstack.make_key(name, False) if self.is_local(key): self.proxy_channels[key] = self.local_channels[key][0] return self.local_channels[key][0] else: if self.proxy_channels.has_key(key): return self.proxy_channels[key] else: ch = Channel(name) self.proxy_channels[key] = ch return ch
def __init__(self, *args): self.key = _dstack.make_key(self) super(_OurTasklet, self).__init__(*args)
def __init__(self, name, distribute = False): self.key = _dstack.make_key(name, False) self.name = name super(Channel, self).__init__() if distribute: self._distribute()