Exemplo n.º 1
0
    public long _2_2_AckJob_Async(Disquuun disquuun)
    {
        WaitUntil("_2_2_AckJob_Async", () => (disquuun.State() == Disquuun.ConnectionState.OPENED), 5);

        var queueId = Guid.NewGuid().ToString();
        var jobId   = DisquuunDeserializer.AddJob(
            disquuun.AddJob(queueId, data_10).DEPRICATED_Sync()
            );

        var w = new Stopwatch();

        w.Start();

        var ackCount = 0;

        disquuun.AckJob(new string[] { jobId }).Async(
            (command, result) =>
        {
            ackCount = DisquuunDeserializer.AckJob(result);
            w.Stop();
        }
            );

        WaitUntil("_2_2_AckJob_Async", () => (ackCount == 1), 5);

        return(w.ElapsedMilliseconds);
    }
Exemplo n.º 2
0
    public void _1_2_AckJob_Sync(Disquuun disquuun)
    {
        WaitUntil("_1_2_AckJob_Sync", () => (disquuun.State() == Disquuun.ConnectionState.OPENED), 5);

        var queueId = Guid.NewGuid().ToString();
        var jobId   = DisquuunDeserializer.AddJob(
            disquuun.AddJob(queueId, new byte[10]).DEPRICATED_Sync()
            );

        var result   = disquuun.AckJob(new string[] { jobId }).DEPRICATED_Sync();
        var ackCount = DisquuunDeserializer.AckJob(result);

        Assert("_1_2_AckJob_Sync", 1, ackCount, "not match.");
    }
Exemplo n.º 3
0
    public void _2_2_AckJob_Async(Disquuun disquuun)
    {
        WaitUntil("_2_2_AckJob_Async", () => (disquuun.State() == Disquuun.ConnectionState.OPENED), 5);

        var queueId = Guid.NewGuid().ToString();
        var jobId   = DisquuunDeserializer.AddJob(
            disquuun.AddJob(queueId, new byte[10]).DEPRICATED_Sync()
            );

        var ackCount = 0;

        disquuun.AckJob(new string[] { jobId }).Async(
            (command, result) => {
            ackCount = DisquuunDeserializer.AckJob(result);
        }
            );

        WaitUntil("_2_2_AckJob_Async", () => (ackCount == 1), 5);
    }
Exemplo n.º 4
0
    public long _1_2_AckJob_Sync(Disquuun disquuun)
    {
        WaitUntil("_1_2_AckJob_Sync", () => (disquuun.State() == Disquuun.ConnectionState.OPENED), 5);
        var w = new Stopwatch();

        w.Start();


        var queueId = Guid.NewGuid().ToString();
        var jobId   = DisquuunDeserializer.AddJob(
            disquuun.AddJob(queueId, data_10).DEPRICATED_Sync()
            );

        var result   = disquuun.AckJob(new string[] { jobId }).DEPRICATED_Sync();
        var ackCount = DisquuunDeserializer.AckJob(result);

        Assert("_1_2_AckJob_Sync", 1, ackCount, "not match.");
        w.Stop();
        return(w.ElapsedMilliseconds);
    }