diff options
author | Eric Wong <e@80x24.org> | 2021-01-10 12:15:08 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-01-12 03:51:42 +0000 |
commit | c1339190c4d682db1cb23331ff0c247f42e3904f (patch) | |
tree | 5735205eebb88db1c5b3fa956d9c368c5efadb43 /t | |
parent | 1ff129f4429686f6dfcde565574f05b21986f6a0 (diff) | |
download | public-inbox-c1339190c4d682db1cb23331ff0c247f42e3904f.tar.gz |
We'll enable automatic cleanup when IPC classes go out-of-scope to avoid leaving zombies around. ->wq_workers will be a useful convenience method to change worker counts.
Diffstat (limited to 't')
-rw-r--r-- | t/ipc.t | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -170,11 +170,15 @@ is($warn[2], $warn[1], 'worker did not die'); $SIG{__WARN__} = 'DEFAULT'; is($ipc->wq_workers_start('wq', 1), $$, 'workers started again'); -is(scalar(keys %{$ipc->{-wq_workers}}), 1, '1 worker started'); +is($ipc->wq_workers, 1, '1 worker started'); $ipc->wq_worker_incr; -is(scalar(keys %{$ipc->{-wq_workers}}), 2, 'worker count bumped'); +is($ipc->wq_workers, 2, 'worker count bumped'); $ipc->wq_worker_decr; $ipc->wq_worker_decr_wait(10); -is(scalar(keys %{$ipc->{-wq_workers}}), 1, 'worker count lowered'); +is($ipc->wq_workers, 1, 'worker count lowered'); +is($ipc->wq_workers(2), 2, 'worker count set'); +is($ipc->wq_workers, 2, 'worker count stayed set'); +$ipc->wq_close; +is($ipc->wq_workers, undef, 'workers undef after close'); done_testing; |