public class Stack extends Object
If the "push" command is used, each argument on the command line is pushed onto the stack (in order) and the program returns immediately.
If the "pop" command is used, the top item on the stack is displayed to the client's stdout. If the stack is empty, the client will block until another process calls push. If the nailgun server is shutdown while pop is blocking, pop will cause the client to exit with exit code 1. This is thread-safe: you can have multiple clients waiting on "pop" and only one of them (determined by the VM and the magic of synchronization) will receive any one pushed item.
Constructor and Description |
---|
Stack() |
Modifier and Type | Method and Description |
---|---|
static void |
nailMain(NGContext context) |
static void |
nailShutdown(NGServer server) |
public static void nailShutdown(NGServer server)
public static void nailMain(NGContext context) throws InterruptedException
InterruptedException
Copyright © 2024. All rights reserved.