Exemple #1
0
 public void Start()
 {
     processing = true;
     while (processing)
     {
         if (queue.Count > 0 & Send != null)
         {
             Tuple tuple = op.execute(queue.Dequeue());
             if (tuple != null)
             {
                 Send(this, (EventArgs)tuple);
                 log("tuple " + url + ", <" + tuple + ">");
             }
         }
         Thread.Sleep(1000);
     }
 }
        private void ProcessTuple(Tuple tuple)
        {
            List <Tuple> tuples = op.execute(tuple);

            if (op.last || tuples == null || tuples.Count == 0)
            {
                tuple.origin.ack(tuple);
            }
            else if (tuples != null)
            {
                tuples.ForEach((t) => {
                    if (t != null)
                    {
                        t.origin = this;
                        t.father = tuple;
                        output_queue.Enqueue(t);
                    }
                });
            }
        }