示例#1
0
        public override void real_work()
        {
            SQueue <Ei> unbemalt = new SQueue <Ei>(this.space, "UnbemalteEier", remote_space_uri);
            SQueue <Ei> bemalt   = new SQueue <Ei>(this.space, "BemalteEier", remote_space_uri);

            while (true)
            {
                try
                {
                    using (XcoTransaction tx = space.BeginTransaction())
                    {
                        Ei e = unbemalt.Dequeue();
                        Console.WriteLine("done");
                        e.Maler = this.id;
                        e.Farbe = this.farbe;
                        bemalt.Enqueue(e);
                        tx.Commit();
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine("Timeout");
                }
                if (Console.KeyAvailable)
                {
                    return;
                }
            }
        }
示例#2
0
        public override void real_work()
        {
            SQueue <SchokoHase> hasen  = new SQueue <SchokoHase>(this.space, "SchokoHasen", remote_space_uri);
            SQueue <Ei>         bemalt = new SQueue <Ei>(this.space, "BemalteEier", remote_space_uri);
            SQueue <Nest>       nester = new SQueue <Nest>(this.space, "Nester", remote_space_uri);

            int count = 0;

            while (true)
            {
                try
                {
                    using (XcoTransaction tx = space.BeginTransaction())
                    {
                        Ei         e1 = bemalt.Dequeue();
                        Ei         e2 = bemalt.Dequeue();
                        SchokoHase sh = hasen.Dequeue();
                        nester.Enqueue(new Nest(id + count.ToString(), id, e1, e2, sh));
                        count = count + 1;
                        tx.Commit();
                        Console.WriteLine("done");
                    }
                }
                catch (Exception e)
                {
                }
                if (Console.KeyAvailable)
                {
                    return;
                }
            }
        }
示例#3
0
 public Nest(string i, string p, Ei ei1, Ei ei2, SchokoHase sh)
     : base(i, p)
 {
     this.e1 = ei1;
     this.e2 = ei2;
     this.sh = sh;
 }