Gearma...eParser(3pm)

πŸ“¦
version 2.004.015 Β· 5 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute

πŸ’– Gearman::ResponseParser πŸ’–

okay bestie, so this is the 3pm page for Gearman::ResponseParser, straight out of the User Contributed Perl Documentation β€” yes the manual name really does get squished into the header like that, we don't make the rules πŸ’…


✨ NAME ✨

Gearman::ResponseParser β€” it's the gearmand abstract response parser implementation. that's the whole vibe. it parses responses. abstractly. for gearmand. periodt πŸŽ€


🌸 DESCRIPTION 🌸

so Gearman::ResponseParser is an abstract base class. it's giving "template, but make it Perl" ✨

see: Gearman::ResponseParser::Taskset β€” that's the glow-up, the actual concrete one, go look at her 🫢

subclasses, listen up: y'all should call this first, and then add your own data in underscore members. that's the rule. call first, customize after. no cap.


πŸ‘‘ METHODS πŸ‘‘

πŸ¦‹ source()

returns source. and what is the source? the source is object/socket. that's it, that's the tea β˜•

πŸ¦‹ on_packet($packet, $parser)

subclasses should override this. literally your moment, your main character energy, do it πŸ’–

πŸ¦‹ on_error($msg, $parser)

subclasses should override this too. same deal. errors happen, handle them your way 🫢

πŸ¦‹ reset()

just... reset(). iconic, no notes, the method speaks for itself 🌈

πŸ¦‹ parse_data($data)

don't override. like fr fr, hands off this one πŸ™ˆ

FUTURE OPTIMIZATION: let caller say "you can own this scalarref", and then we can keep it on the initial setting of $self->{data} and avoid copying into our own. overkill for now. (so like, that's a someday-thing, not a today-thing, don't come for me 😭)

πŸ¦‹ eof()

don't override. bestie I'm begging you πŸ’€

πŸ¦‹ parse_sock($sock)

don't override. same energy, same warning ✨

and here's the tea: $sock is readable, we should sysread it and feed it to parse_data($data). that's the whole flow. read it, feed it, done πŸŽ€


and that's the page, bestie!! written for perl v5.26.2, dated 2018-08-30 β€” yes she's a lil vintage, but vintage is just pre-loved πŸ’œ mwah, go parse some responses 🌸✨

πŸ“¦ where this page comes from