Package rx.functions

Examples of rx.functions.Action0


        }).enableWireLogging(LogLevel.ERROR).build().start();
        final CountDownLatch finishLatch = new CountDownLatch(1);
        HttpClientResponse<ByteBuf> response = RxNetty.<ByteBuf, ByteBuf>newHttpClientBuilder("localhost", server.getServerPort())
                                                      .enableWireLogging(LogLevel.DEBUG).build()
                                                      .submit(HttpClientRequest.createGet("/"))
                                                      .finallyDo(new Action0() {
                                                          @Override
                                                          public void call() {
                                                              finishLatch.countDown();
                                                          }
                                                      }).toBlocking().toFuture().get(10, TimeUnit.SECONDS);
View Full Code Here


                .start();
       
        final CountDownLatch finishLatch = new CountDownLatch(1);
        HttpClientResponse<ByteBuf> response = RxNetty.createHttpClient("localhost", server.getServerPort())
                                                      .submit(HttpClientRequest.createGet("/"))
                                                      .finallyDo(new Action0() {
                                                          @Override
                                                          public void call() {
                                                              finishLatch.countDown();
                                                          }
                                                      }).toBlocking().toFuture().get(10, TimeUnit.SECONDS);
View Full Code Here

                          @Override
                          public Observable<ByteBuf> call(HttpClientResponse<ByteBuf> response) {
                              return response.getContent();
                          }
                      })
                      .finallyDo(new Action0() {
                          @Override
                          public void call() {
                              finishLatch.countDown();
                          }
                      }).toBlocking().toFuture().get(10, TimeUnit.SECONDS);
View Full Code Here

                .start();
       
        final CountDownLatch finishLatch = new CountDownLatch(1);
        HttpClientResponse<ByteBuf> response = RxNetty.createHttpClient("localhost", server.getServerPort())
                                                      .submit(HttpClientRequest.createGet("/notfound.json"))
                                                      .finallyDo(new Action0() {
                                                          @Override
                                                          public void call() {
                                                              finishLatch.countDown();
                                                          }
                                                      }).toBlocking().toFuture().get(10, TimeUnit.SECONDS);
View Full Code Here

                .start();
       
        final CountDownLatch finishLatch = new CountDownLatch(1);
        HttpClientResponse<ByteBuf> response = RxNetty.createHttpClient("localhost", server.getServerPort())
                                                      .submit(HttpClientRequest.createGet("/../badfile.json"))
                                                      .finallyDo(new Action0() {
                                                          @Override
                                                          public void call() {
                                                              finishLatch.countDown();
                                                          }
                                                      }).toBlocking().toFuture().get(10, TimeUnit.SECONDS);
View Full Code Here

        final long[] idleCountOnComplete = {0};
        final long[] inUseCountOnComplete = {0};
        final long[] totalCountOnComplete = {0};

        Action0 onComplete = new Action0() {
            @Override
            public void call() {
                idleCountOnComplete[0] = stats.getIdleCount();
                inUseCountOnComplete[0] = stats.getInUseCount();
                totalCountOnComplete[0] = stats.getTotalConnectionCount();
View Full Code Here

                    });
                } else {
                    return Observable.error(new AssertionError("Unexpected response code: " + response.getStatus().code()));
                }
            }
        }).finallyDo(new Action0() {
            @Override
            public void call() {
                completionLatch.countDown();
            }
        }).toBlocking().forEach(new Action1<String>() {
View Full Code Here

                    @Override
                    public Observable<ByteBuf> call(HttpClientResponse<ByteBuf> response) {
                        toReturnRef.set(response);
                        return response.getContent();
                    }
                }).finallyDo(new Action0() {
                    @Override
                    public void call() {
                        completionLatch.countDown();

                    }
View Full Code Here

                              });
        ObservableConnection<HttpClientResponse<ByteBuf>, HttpClientRequest<ByteBuf>> conn = connectionObservable.toBlocking().last();
        Assert.assertFalse("Connection already closed.", conn.isCloseIssued());

        final CountDownLatch responseCompleteLatch = new CountDownLatch(1);
        content.finallyDo(new Action0() {
            @Override
            public void call() {
                responseCompleteLatch.countDown();
            }
        }).subscribe();
View Full Code Here

        ObservableConnection<String, String> conn = pool.acquire().toBlocking().last();
        Assert.assertEquals("Unexpected pool idle count.", 0, stats.getIdleCount());
        Assert.assertEquals("Unexpected pool in-use count.", 1, stats.getInUseCount());
        Assert.assertEquals("Unexpected pool total connections count.", 1, stats.getTotalConnectionCount());
        final CountDownLatch writeFinishLatch = new CountDownLatch(1);
        conn.writeAndFlush("Hi").finallyDo(new Action0() {
            @Override
            public void call() {
                writeFinishLatch.countDown();
            }
        });
View Full Code Here

TOP

Related Classes of rx.functions.Action0

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.