UV/Handle/Signal.pm untested

filter: Statementstmt n/a Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a SCAR -
1 package SPVM::UV::Handle::Signal;
2  
3 1;
4  
5 =encoding utf8
6  
7 =head1 Name
8  
9 SPVM::UV::Handle::Signal - Signal Handle for libuv
10  
11 =head1 Description
12  
13 C<UV::Handle::Signal> in L<SPVM> represents the signal handle for L<libuv|https://libuv.org/>, corresponding to the C<uv_signal_t> structure.
14  
15 =head1 Super Class
16  
17 L<UV::Handle|SPVM::UV::Handle>
18  
19 =head1 Usage
20  
21 use UV::Handle::Signal;
22
23 my $signal = UV::Handle::Signal->new;
24  
25 =head1 Fields
26  
27 =head2 signal_cb
28  
29 C<has signal_cb : rw L<UV::Callback::Signal|SPVM::UV::Callback::Signal>;>
30  
31 The callback called when the signal is received.
32  
33 =head1 Class Methods
34  
35 =head2 new
36  
37 C<static method new : L<UV::Handle::Signal|SPVM::UV::Handle::Signal> ();>
38  
39 Creates a new L<UV::Handle::Signal|SPVM::UV::Handle::Signal> object, and returns it.
40  
41 =head1 Instance Methods
42  
43 =head2 start
44  
45 C<method start : void ($cb : L<UV::Callback::Signal|SPVM::UV::Callback::Signal>, $signum : int);>
46  
47 Starts the signal handle with the callback C<$cb> and the signal number C<$signum>.
48  
49 The callback C<$cb> is stored in L</"signal_cb"> field.
50  
51 The callback C<$cb> is invoked when the signal C<$signum> is received.
52  
53 This method calls the L<uv_signal_start|https://docs.libuv.org/en/v1.x/signals.html#c.uv_signal_start> function.
54  
55 Exceptions:
56  
57 If $cb is not defined, an exception is thrown.
58  
59 If uv_signal_start fails, an exception is thrown.
60  
61 =head2 stop
62  
63 C<method stop : void ();>
64  
65 Stops the signal handle.
66  
67 This method calls the L<uv_signal_stop|https://docs.libuv.org/en/v1.x/signals.html#c.uv_signal_stop> function.
68  
69 Exceptions:
70  
71 If uv_signal_stop fails, an exception is thrown.
72  
73 =head1 Repository
74  
75 L<https://github.com/kimoto/SPVM-UV>
76  
77 =head1 Author
78  
79 Yuki Kimoto C<kimoto.yuki@gmail.com>
80  
81 =head1 Copyright & License
82  
83 Copyright (c) 2026 Yuki Kimoto
84  
85 MIT License