Exemplo n.º 1
0
        private ReduceReceiver(
            [Parameter(typeof(GroupCommConfigurationOptions.OperatorName))] string operatorName,
            [Parameter(typeof(GroupCommConfigurationOptions.CommunicationGroupName))] string groupName,
            [Parameter(typeof(GroupCommConfigurationOptions.Initialize))] bool initialize,
            OperatorTopology <PipelineMessage <T> > topology,
            ICommunicationGroupNetworkObserver networkHandler,
            IReduceFunction <T> reduceFunction,
            IPipelineDataConverter <T> dataConverter)
        {
            OperatorName          = operatorName;
            GroupName             = groupName;
            Version               = PipelineVersion;
            ReduceFunction        = reduceFunction;
            PipelineDataConverter = dataConverter;

            _pipelinedReduceFunc = new PipelinedReduceFunction <T>(ReduceFunction);
            _topology            = topology;

            var msgHandler = Observer.Create <GeneralGroupCommunicationMessage>(message => topology.OnNext(message));

            networkHandler.Register(operatorName, msgHandler);

            if (initialize)
            {
                topology.Initialize();
            }
        }
Exemplo n.º 2
0
        private ReduceReceiver(
            [Parameter(typeof(GroupCommConfigurationOptions.OperatorName))] string operatorName,
            [Parameter(typeof(GroupCommConfigurationOptions.CommunicationGroupName))] string groupName,
            [Parameter(typeof(GroupCommConfigurationOptions.Initialize))] bool initialize,
            OperatorTopology <PipelineMessage <T> > topology,
            IReduceFunction <T> reduceFunction,
            IPipelineDataConverter <T> dataConverter)
        {
            OperatorName          = operatorName;
            GroupName             = groupName;
            Version               = PipelineVersion;
            ReduceFunction        = reduceFunction;
            PipelineDataConverter = dataConverter;
            _initialize           = initialize;

            _pipelinedReduceFunc = new PipelinedReduceFunction <T>(ReduceFunction);
            _topology            = topology;
        }