Examples of shutdownGracefully()


Examples of io.netty.channel.local.LocalEventLoopGroup.shutdownGracefully()

            // Wait until all messages are flushed before closing the channel.
            if (lastWriteFuture != null) {
                lastWriteFuture.awaitUninterruptibly();
            }
        } finally {
            serverGroup.shutdownGracefully();
            clientGroup.shutdownGracefully();
        }
    }
}
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup.shutdownGracefully()

    this.server = new MockApnsServer(GATEWAY_PORT, serverEventLoopGroup);

    // We want to do a dummy run first to let the JVM warm up
    final NioEventLoopGroup warmupGroup = new NioEventLoopGroup(1);
    this.runBenchmark(warmupGroup, 1, this.notifications);
    warmupGroup.shutdownGracefully().await();

    System.out.println("threads, connections, throughput [k/sec]");

    for (int eventLoopGroupThreadCount : new int[] {1, 2, 4, 8, 16}) {
      final NioEventLoopGroup eventLoopGroup = new NioEventLoopGroup(eventLoopGroupThreadCount);
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup.shutdownGracefully()

              concurrentConnectionCount,
              throughput / 1000.0);
        }
      }

      eventLoopGroup.shutdownGracefully().await();
    }

    this.serverEventLoopGroup.shutdownGracefully().await();
  }
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup.shutdownGracefully()

      providedGroupPushManager.shutdown();

      assertTrue(providedGroupPushManager.isShutDown());
      assertFalse(group.isShutdown());

      group.shutdownGracefully();
    }

    {
      final ExecutorService listenerExecutorService = Executors.newSingleThreadExecutor();
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup.shutdownGracefully()

            // Multipart Post form: factory used
            formpostmultipart(b, host, port, uriFile, factory, headers, bodylist);
        } finally {
            // Shut down executor threads to exit.
            group.shutdownGracefully();

            // Really clean all temporary files if they still exist
            factory.cleanAllHttpData();
        }
    }
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup.shutdownGracefully()

                    WebSocketFrame frame = new TextWebSocketFrame(msg);
                    ch.writeAndFlush(frame);
                }
            }
        } finally {
            group.shutdownGracefully();
        }
    }
}
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup.shutdownGracefully()

        } finally {
            logger.info("Shutting down thread pools");

            gremlinGroup.shutdownGracefully();
            bossGroup.shutdownGracefully();
            workerGroup.shutdownGracefully();

            logger.info("Gremlin Server - shutdown complete");
        }
    }
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup.shutdownGracefully()

          catch (Exception e) {
            throw new RuntimeException(e);
          }
          finally {
            bossGroup.shutdownGracefully();
            workerGroup.shutdownGracefully();
          }
        }
      });

    }
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup.shutdownGracefully()

            // Multipart Post form: factory used
            formpostmultipart(b, host, port, uriFile, factory, headers, bodylist);
        } finally {
            // Shut down executor threads to exit.
            group.shutdownGracefully();

            // Really clean all temporary files if they still exist
            factory.cleanAllHttpDatas();
        }
    }
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup.shutdownGracefully()

            // In this example, this does not happen, but you can do that to gracefully
            // shut down your server.
            f.channel().closeFuture().sync();
        } finally {
            this.state = ServerState.STOPPING;
            workerGroup.shutdownGracefully();
            bossGroup.shutdownGracefully();
        }
    }

    public enum ServerState {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.