From e3f00c42863737e588218fe904aed54449d4cf23 Mon Sep 17 00:00:00 2001
From: Eric Wong <e@80x24.org>
Date: Thu, 24 Sep 2015 03:37:20 +0000
Subject: [PATCH] nntpd: better encapsulation for shutdown

We can use the UNIVERSAL::can to better encapsulate the shutdown
process, in case we need to implement a gopher or HTTP daemon.
---
 public-inbox-nntpd | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/public-inbox-nntpd b/public-inbox-nntpd
index 70bab46f..9fb69cec 100644
--- a/public-inbox-nntpd
+++ b/public-inbox-nntpd
@@ -204,8 +204,7 @@ sub worker_quit {
 		my $n = 0;
 
 		foreach my $s (values %$dmap) {
-			next unless ref($s) eq 'PublicInbox::NNTP';
-			if ($s->busy) {
+			if ($s->can('busy') && $s->busy) {
 				++$n;
 			} else {
 				$s->close;
-- 
2.51.0