From 92060db9947b6bcf27630b985415505379fd84dd Mon Sep 17 00:00:00 2001 From: Denis Knauf Date: Tue, 30 Nov 2021 14:09:35 +0100 Subject: [PATCH] More readable description for RobusServer-class. --- lib/robustserver.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/robustserver.rb b/lib/robustserver.rb index 4ecc63f..91fc1d9 100644 --- a/lib/robustserver.rb +++ b/lib/robustserver.rb @@ -95,14 +95,15 @@ end # Easy problem-handler for your Server. # -# A Server should never crash. -# If an Exception raised, which is not rescued, your program will shutdown abnormaly. -# Or if a signal tries to "kill" your program, your program will shutdown abnormaly too. +# Problem: Your process should not crash, it should be available for anytime. +# If an exception will be raised, you have to handle it, or it will be shutdown abnormaly. +# Or if a signal tries to "kill" your program, your program will shutdown abnormaly, too. # -# With RobustServer these errors will be a more unimportant problem and It'll be easier to handle. +# RobustServer handles any exception / kill, logs it and prevents the server to shutting down. # -# Subclasses should implements *#run*, which will be your main-worker. -# For initializing, you can override **#initialize**, but doen't forget to call **super**. +# For implementation a server, create a subclass of RobustServer and implement the *#run*-method. +# Anytime this *#run*-method returns or an exception will be raised, it will be rescued and run recalled. +# For initialization, you can override **#initialize**, but don't forget to call **super**. class RobustServer class UnimplementedRun