nitcorn :: signal_handler $ HttpFactory
Factory to createHttpServer
instances, and hold the libevent base handler
nitcorn :: signal_handler $ HttpFactory
Factory to createHttpServer
instances, and hold the libevent base handler
HttpRequest
class and services to create it
Serializable::inspect
to show more useful information
more_collections :: more_collections
Highly specific, but useful, collections-related classes.serialization :: serialization_core
Abstract services to serialize Nit objects to different formatscore :: union_find
union–find algorithm using an efficient disjoint-set data structurenitc :: api_metrics
restful
annotation documented at lib/nitcorn/restful.nit
root
to execute
# Handle SIGINT and SIGTERM to close the server after all active events
module signal_handler
import reactor
redef class HttpFactory
super EventCallback
private var signal_handlers: Array[NativeEvSignal] = [
new NativeEvSignal(event_base, 2, self), # SIGINT
new NativeEvSignal(event_base, 15, self) # SIGTERM
] is lazy
redef fun run
do
for handler in signal_handlers do handler.add
super
end
redef fun callback(events)
do
event_base.loopexit
for handler in signal_handlers do handler.del
end
end
lib/nitcorn/signal_handler.nit:15,1--39,3