From b8e30717b529d6461190b54efa8c6402197cdd4e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 3 Mar 2016 05:14:30 +0000 Subject: daemon: avoid polluting the main package We've distilled the daemon code into one public function ("run"), so avoid polluting the main namespace and just have users prefix with the full package name for this rarely-used class. --- script/public-inbox-httpd | 2 +- script/public-inbox-nntpd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'script') diff --git a/script/public-inbox-httpd b/script/public-inbox-httpd index 21579622..d867b477 100755 --- a/script/public-inbox-httpd +++ b/script/public-inbox-httpd @@ -49,7 +49,7 @@ my $refresh = sub { } }; -daemon_run('0.0.0.0:8080', $refresh, +PublicInbox::Daemon::run('0.0.0.0:8080', $refresh, sub ($$$) { # post_accept my ($client, $addr, $srv) = @_; my $fd = fileno($srv); diff --git a/script/public-inbox-nntpd b/script/public-inbox-nntpd index 23d269d4..cea88163 100755 --- a/script/public-inbox-nntpd +++ b/script/public-inbox-nntpd @@ -10,7 +10,7 @@ require PublicInbox::NewsGroup; require PublicInbox::NNTP; require PublicInbox::Config; my $nntpd = PublicInbox::NNTPD->new; -daemon_run('0.0.0.0:119', +PublicInbox::Daemon::run('0.0.0.0:119', sub { $nntpd->refresh_groups }, # refresh sub ($$$) { PublicInbox::NNTP->new($_[0], $nntpd) }); # post_accept -- cgit v1.2.3-24-ge0c7