Async-Redis

 view release on metacpan or  search on metacpan

t/lib/Test/Async/Redis.pm  view on Meta::CPAN

# Async delay
async sub delay {
    my ($seconds) = @_;
    await Future::IO->sleep($seconds);
}

# Force EOF on the socket under the reader. Next read returns 0 bytes,
# triggering the reader's EOF handling path. Uses shutdown() rather
# than close() so the file descriptor stays valid for Future::IO's
# select loop — close() on an fh that Future::IO has an active poller
# on leaves a stale watcher whose fileno is undef, which taints select()
# with uninit warnings.
sub inject_eof {
    my ($redis) = @_;
    shutdown($redis->{socket}, 2) if $redis->{socket};
}

# Feed bytes directly into the parser, bypassing the socket. Useful
# for exercising the reader's decode/dispatch path with a crafted frame.
sub inject_unexpected_frame {
    my ($redis, $raw_bytes) = @_;



( run in 1.579 second using v1.01-cache-2.11-cpan-751830e7986 )