Tirex::Job(3pm)

πŸ¦‹ Tirex::Job β€” the manual page, but make it a group chat

hey bestie πŸ’– so this is Tirex::Job(3pm), and it's lowkey one of the most important little guys in the whole Tirex universe. it's literally a rendering job. that's it, that's the vibe. come sit with me, we're gonna go through the whole thing, no skipping, not even the "boring" parts (there are no boring parts, i checked 🫢).


✨ NAME ✨

Tirex::Job β€” A Tirex rendering job πŸŽ€


🌸 SYNOPSIS 🌸

okay so this is how you'd actually summon one of these bad boys:

my $job = Tirex::Job->new( metatile => $metatile, prio => 5, expire =>
time() + 60*60 );

look at her. iconic. moving on πŸ’…


πŸ’œ DESCRIPTION πŸ’œ

so a Tirex job is made of a metatile, a rendering priority and an expire time β€” plus some optional extra info if you're feeling spicy ✨.

and when do these little guys get born? when rendering requests reach the master, that's when. then they get yeeted straight into the queue. that's the whole life cycle, no cap 🧚


πŸ‘‘ METHODS πŸ‘‘

this is the good part, bestie. buckle up.

🌟 Tirex::Job->new( ... )

creates a brand new job. slay.

a job always needs these two parameters, no exceptions, periodt:

  • metatile β€” the metatile πŸ’–
  • prio β€” priority (an integer >= 1, and 1 is the highest priority)

and it can have any or all of these optional ones:

  • expire β€” the time when this job will expire (seconds since epoch) ⏰
  • request_time β€” the time when this request came in (seconds since epoch, will be set to current time if not set) πŸ•

🌟 $job->same_tile($other_job)

returns true if both jobs concern the same metatile, false otherwise πŸ’β€β™€οΈ

"same tile" means: same map, same x and y coordinates, and same zoom level. that's the whole check, fr fr.


🌟 $job->expired()

returns 1 if this job is expired, 0 otherwise.

and if the job doesn't have an expire time at all? it returns undef. rude but okay πŸ™ˆ


🌟 $job->to_s( foo => 'bar' )

creates a message string from the job. it contains the fields id, map, x, y, and z from the job, plus all the fields you handed it as arguments.


🌟 $job->to_msg( foo => 'bar' )

creates a message from the job. it contains the fields id, map, x, y, z, prio from the job and, if available, the field priority.

all the fields you pass as arguments to this method also get added in there. and heads up: you must give a type argument, otherwise this will croak πŸ’€ it's not playing around.


🌟 $job->get_id()

get the unique id of this job. she's one of a kind πŸ’…


🌟 $job->get_prio()

get the priority of this job.


🌟 $job->set_prio($prio)

set the priority of this job.


🌟 $job->get_metatile()

get the metatile of this job.


🌟 $job->get_pos()

get the position of this job in the priority queue. returns undef if the job is in no queue πŸ«₯


🌟 $job->set_pos($pos)

set the position of this job in the priority queue. set it to undef if the job is in no queue.


🌟 $job->get_bucket()

get the bucket for this job πŸͺ£


🌟 $job->set_bucket($bucket)

set the bucket for this job.


🌟 $job->get_success()

get the success flag for this job.


🌟 $job->set_success($success)

set the success flag for this job.


🌟 $job->hash_key()

creates a hash key (a string) from the contents of this job. only the attributes describing the tile get included, so that this hash key is unique for any tile πŸ”‘βœ¨


🌟 $job->merge($secondjob)

merges two jobs for the same metatile into one. this method looks into both jobs and creates a new job from the data. the old jobs are not changed, they just stay there vibing.

here's exactly how the new job gets built, no guessing:

  • priority of the new job will be the minimum of the priorities of the old jobs
  • expire will be the maximum of the expire times of the old jobs β€” but if there is no expire time for at least one job, the result will have no expire time either
  • notify will be the concatenation of both notifies
  • request_time will be the minimum of both request times
⚠️ also important: this method assumes that the metatiles are the same. it does no check. so like… be normal about it 😭

🌟 $job->add_notify($source)

add a Tirex::Source to be notified when this job is done πŸ“£


🌟 $job->has_notify()

returns true if any sources are waiting to be notified of this job's completion πŸ‘€


🌟 $job->notify()

notify all sources that this job is done. returns an array reference with the result of the notify calls on the sources.

also β€” it clears the notify list 🧹


🌟 $job->sources_as_string()

the sources of this job as a string (for logging) πŸ“


🌟 $job->age()

returns the age of this job in seconds β€” aka the difference between the current time and the request time ⏳


okay that's the whole page, you made it, i'm so proud of you πŸ₯ΉπŸ’– go render something, bestie.

this manual page was brought to you by perl v5.40.1, dated 2026-08-09, and it's the Tirex::Job(3pm) page β€” mwah, talk later 🫢✨

πŸ“¦ where this page comes from