A few things:
To sum up:
use threads; use strict; { package ThreadableObj; use Moose; use threads::shared; use Data::Dumper; around 'new' => sub { my $orig = shift; my $class = shift; my $self = $class->$orig(@_); my $shared_self : shared = shared_clone($self); # here the blessed() already be the version in threads::shared print Dumper($shared_self),"\n"; return $shared_self; }; has foo => ( is => 'rw', isa => 'Str' ); has bar => ( is => 'rw', isa => 'Int' ); } # here lives my $obj : shared = ThreadableObj->new(foo=>'foovalue');
In reply to Re: Attempt to make shared Moose object
by tigre
in thread Attempt to make shared Moose object
by llancet
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |