Example #1
0
        public async Task ToInputAsync(IAsyncVertexInputEndpoint endpoint, string otherVertex, string otherEndpoint, CancellationToken token)
        {
            Console.WriteLine("Sending data to fused vertex: " + otherVertex + ", endpoint: " + otherEndpoint);

            MyAsyncFusableInput otherInstance = endpoint as MyAsyncFusableInput;

            for (int i = 0; i < int.MaxValue; i += 1)
            {
                for (int j = 0; j < 1; j++)
                {
                    otherInstance.WriteInt32(i + j);
                    Console.WriteLine("Written value: " + (i + j));
                }


                for (int j = 0; j < 1; j++)
                {
                    Thread.Sleep(1000);
                    token.ThrowIfCancellationRequested();
                }

                if (!_running)
                {
                    break;
                }
            }
        }
Example #2
0
 /// <summary>
 /// Vertex implementor uses this to add async input endpoint
 /// </summary>
 /// <param name="key"></param>
 /// <param name="input"></param>
 protected virtual void AddAsyncInputEndpoint(string key, IAsyncVertexInputEndpoint input)
 {
     lock (this)
     {
         onAddAsyncInputEndpoint(key, input);
     }
 }
Example #3
0
 public bool CanFuseWith(IAsyncVertexInputEndpoint endpoint, string otherVertex, string otherEndpoint)
 {
     if (endpoint as MyAsyncFusableInput != null)
     {
         return(true);
     }
     return(false);
 }
Example #4
0
        public async Task ToInputAsync(IAsyncVertexInputEndpoint inputEndpoint, string otherVertex, string otherEndpoint, CancellationToken token)
        {
            _inputEndpoint = inputEndpoint as OperatorFusableInput;
            bool isAdded = await _inputEndpoint.AddOperatorFusableInput();

            if (isAdded)
            {
                IEndpointContent endpointContent = new ObjectEndpoint();
                ((ObjectEndpoint)endpointContent).SetOperatorOutputEndpoint(this);

                _operator.AddOutput(_thisId, ref endpointContent);
                _operator.WaitForOutputCompletion(_thisId);
            }
        }