Net::H...::Task(3pm)

✨ NAME ✨

Net::Hotline::Task β€” the Task object that Net::Hotline::Client uses internally, bestie πŸ’–

(yeah, the page header calls it Net::H...::Task(3pm), that's just the name being shy and getting cut off πŸŽ€)


🌸 SYNOPSIS 🌸

use Net::Hotline::Task;

$task = new Net::Hotline::Task;

$task->start(time());
$task->num($num++);
...

πŸ¦‹ DESCRIPTION πŸ¦‹

Net::Hotline::Task is a simple little class for storing and retrieving task info. That's the whole job. It's giving "storage unit for task data" and honestly? It ate. πŸ’…

okay so real talk: you should never have to make your own Net::Hotline::Task objects when you're using Net::Hotline::Client. Like, ever. Not your job, not your problem, stay in your lane queen. Getting attributes is basically all you'll ever need, and setting them is to a lesser extent a thing you might do. That's it. 😌

πŸŽ€ CONSTRUCTION πŸŽ€

  • new NUM, TYPE, START, SOCKET, PATH β€” no args at all? Cute, you get a brand new Net::Hotline::Task object with every single attribute set to undef. Empty. Blank. A little baby object, no thoughts head empty 🫢

Give it three or four args (PATH is optional, she's flexible ✨) and you get a new Net::Hotline::Task object with task number NUM, task type TYPE, start time START, user socket number SOCKET, and file path PATH. Periodt. πŸ‘‘


πŸ’œ METHODS πŸ’œ

All the Net::Hotline::Task methods are just simple attribute get/set routines β€” no drama, no hidden lore, iykyk. Hand one an argument and it sets that attribute. In all cases, they return the current value of the attribute. So like, give it a value, it remembers; ask it something, it tells you. Main character behavior fr fr. 🌈

  • error EXPR β€” the error state of the task. A true value means there was an error. πŸ’€
  • error_text TEXT β€” the error message text. Heads up though: this only applies if error() returns a true value. No error, no text, don't even try it bestie.
  • finish TIME β€” the time that a task completed, in platform-native time format (i.e. seconds since the epoch on a Unix system). ⏰
  • num NUMBER β€” the unique task number. And the way these numbers just increase sequentially? Obsessed. They go up. One after another. Every time. πŸ”’
  • path PATH β€” the path information associated with a task (if any). Now listen, this one's got layers: in situations where two paths may be associated with a task β€” a "move file" task, for example β€” you get back a reference to an array containing the paths. Surprise! It's an arrayref. πŸ“
  • socket NUMBER β€” the unique user socket number associated with a task (if any). πŸ”Œ
  • start TIME β€” the time (in platform-native time format) that a task was started. ⏱️
  • type TASK_TYPE β€” the HTLC_TASK_XXX constant specifying the type of task. These constants live in Net::Hotline::Constants, and they include:
HTLC_TASK_KICK         Disconnect a user.
HTLC_TASK_LOGIN        Log into server.
HTLC_TASK_NEWS         Get the news.
HTLC_TASK_NEWS_POST    Post to news.
HTLC_TASK_FILE_DELETE  Delete a file.
HTLC_TASK_FILE_INFO    Get file information.
HTLC_TASK_FILE_LIST    Get a file list.
HTLC_TASK_FILE_MKDIR   Create a new folder.
HTLC_TASK_FILE_MOVE    Move a file.
HTLC_TASK_SEND_MSG     Send a private message.
HTLC_TASK_SET_INFO     Set file information.
HTLC_TASK_USER_INFO    Get user information.
HTLC_TASK_USER_LIST    Get the userlist.

πŸ‘‘ AUTHOR πŸ‘‘

John C. Siracusa (siracusa@mindspring.com) β€” the icon, the legend, the one who wrote it πŸ’–


Copyright(c) 1999 by John Siracusa. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. 🫢


and that's the whole page, bestie!! this one's documented as Net::H...::Task(3pm), built from perl v5.32.0, dated 2021-01-09 β€” no cap, that's the tea πŸ’…βœ¨

πŸ“¦ where this page comes from