# # spec file for package perl-Thread-Queue # # Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %define cpan_name Thread-Queue Name: perl-Thread-Queue Version: 3.13 Release: 0 License: Artistic-1.0 OR GPL-1.0-or-later Summary: Thread-safe queues URL: https://metacpan.org/release/%{cpan_name} Source0: https://cpan.metacpan.org/authors/id/J/JD/JDHEDDEN/%{cpan_name}-%{version}.tar.gz Source1: cpanspec.yml Source100: README.md BuildArch: noarch BuildRequires: perl BuildRequires: perl-macros BuildRequires: perl(threads::shared) >= 1.21 Requires: perl(threads::shared) >= 1.21 %{perl_requires} %description This module provides thread-safe FIFO queues that can be accessed safely by any number of threads. Any data types supported by threads::shared can be passed via queues: * Ordinary scalars * Array refs * Hash refs * Scalar refs * Objects based on the above Ordinary scalars are added to queues as they are. If not already thread-shared, the other complex data types will be cloned (recursively, if needed, and including any 'bless'ings and read-only settings) into thread-shared structures before being placed onto a queue. For example, the following would cause Thread::Queue to create a empty, shared array reference via '&shared([])', copy the elements 'foo', 'bar' and 'baz' from '@ary' into it, and then place that shared reference onto the queue: my @ary = qw/foo bar baz/; $q->enqueue(\@ary); However, for the following, the items are already shared, so their references are added directly to the queue, and no cloning takes place: my @ary :shared = qw/foo bar baz/; $q->enqueue(\@ary); my $obj = &shared({}); $$obj{'foo'} = 'bar'; $$obj{'qux'} = 99; bless($obj, 'My::Class'); $q->enqueue($obj); See "LIMITATIONS" for caveats related to passing objects via queues. %prep %autosetup -n %{cpan_name}-%{version} %build perl Makefile.PL INSTALLDIRS=vendor %make_build %check make test %install %perl_make_install %perl_process_packlist %perl_gen_filelist %files -f %{name}.files %doc Changes examples README %changelog