POE::D...:SysRW(3pm)

πŸ’– POE::Driver::SysRW β€” the vibe πŸ’–

okay bestie, welcome to POE::Driver::SysRW, a page from the User Contributed Perl Documentation section of the manual (section 3pm, for the perl girlies who love a module) 🫢


✨ NAME ✨

POE::Driver::SysRW β€” buffered, non-blocking I/O using sysread and syswrite πŸ’…


🌸 SYNOPSIS 🌸

ngl, the synopsis lives over in "SYNOPSIS" in POE::Driver and it shows you exactly how the interface works. This module? It's literally just one implementation of that vibe. That's it. That's the whole thing. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

This driver implements POE::Driver using sysread and syswrite. no cap, that's the description. iconic behavior honestly πŸŽ€


πŸ‘‘ PUBLIC METHODS πŸ‘‘

POE::Driver::SysRW brings some extra little treats that the base interface doesn't cover. main character energy fr fr πŸ’œ

πŸ“ new [BlockSize => OCTETS]

new() creates a brand new buffered I/O driver that uses sysread() to read data from a handle and syswrite() to flush data to that handle. slay πŸ’…

The constructor accepts one optional named parameter, BlockSize, which tells you the maximum number of OCTETS that will be read at one time.

BlockSize is 64 kilobytes (65536 octets) by default. Higher values may improve performance in streaming applications, but the trade-off is a lower event granularity and increased resident memory usage. (it's giving "faster but thirstier" 😭)

Lower BlockSize values reduce memory consumption somewhat, with corresponding throughput penalties.

my $driver = POE::Driver::SysRW->new;

my $driver = POE::Driver::SysRW->new( BlockSize => $block_size );

Drivers are commonly instantiated within POE::Wheel constructor calls:

$_[HEAP]{wheel} = POE::Wheel::ReadWrite->new(
  InputHandle => \*STDIN,
  OutputHandle => \*STDOUT,
  Driver => POE::Driver::SysRW->new(),
  Filter => POE::Filter::Line->new(),
);

Applications almost always use POE::Driver::SysRW, so POE::Wheel objects almost always will create their own if no Driver is specified. it just handles it for you, bestie, no thoughts required 🧚

🌈 All Other Methods

POE::Driver::SysRW documents the abstract interface documented in POE::Driver. Please see POE::Driver for more details about the following methods β€” go read the source material, iykyk πŸ“š:

  • flush
  • get
  • get_out_messages_buffered
  • put

πŸ’€ SEE ALSO πŸ’€

  • POE::Driver
  • POE::Wheel

Also see the SEE ALSO section of POE, which contains a brief roadmap of POE's documentation. it's the group chat of docs, fr fr πŸ—ΊοΈ


πŸ’œ AUTHORS & COPYRIGHTS πŸ’œ

Please see POE for more information about authors and contributors. 🫢


bestie reminder: this is the POE::Driver::SysRW page, section 3pm, shipped with perl v5.34.0 and dated 2022-03-25. that's the whole page, you ate that, periodt πŸ’–βœ¨πŸŽ€
πŸ“¦ where this page comes from