예제 #1
0
    def add_termination(self, input_socket, *args, **kwargs):
        ## We get a unique name for the inputs so that the ensemble doesn't
        ## need to do so and we can then use the unique_name to identify
        ## the input sockets
        unique_name = self.ensemble.get_unique_name(kwargs['name'],
                self.unique_socket_names)

        self.unique_socket_names[unique_name] = ""
        kwargs['name'] = unique_name

        self.input_sockets.append(zmq_utils.Socket(input_socket, unique_name))

        return self.ensemble.add_termination(*args, **kwargs)
예제 #2
0
 def add_input(self, input_socket):
     # probes have a one to one mapping with a target ensembles
     # thus will have just one input and can use the probe name for the input socket
     self.input_socket = zmq_utils.Socket(input_socket, self.name)
예제 #3
0
 def add_output(self, output_socket_def):
     # the name is not used but may be nice to have for debugging
     name = self.func.__name__ if self.func is not None else 'X'
     self.output_sockets.append(zmq_utils.Socket(output_socket_def, name))