---
name: "Tirex::Source::ModTile"
section: "3pm"
platform: "linux"
package: "tirex"
version: "0.7.1-3+b2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Tirex::Source::ModTile"
---

# Tirex::Source::ModTile(3pm)

## NAME

Tirex::Source::ModTile -- mod\_tile a a source of job requests

## SYNOPSIS

```
 my $source = &Tirex::Source::ModTile->new();
 $source->notify();
```

## DESCRIPTION

Source using Tirex messages sent through mod\_tile (Unix domain socket)

## METHODS

### Tirex::Source::ModTile-\>new()

Create source object for Unix domain socket connection.

### $source-\>readable($sock)

Indicates to this source that the given socket is readable, and has data for this source.

The source will return STATUS\_CONTINUE if it expects to continue reading,  or STATUS\_MESSAGE\_COMPLETE if reading is complete. STATUS\_SOCKET\_CLOSED  indicates that the peer has closed the connection.

### $source-\>make\_job($sock)

Returns a new Tirex::Job object created from the data read by this source.  Also decides whether or not this source would like to be notified of  job completion, and if yes, flags the job accordingly.

These are the priority levels used in the Apache mod\_tile and how they  are translated in Tirex. (Note that in mod\_tile the numbers do not imply higher or lower priority.)

*cmdRender (1 in mod\_tile, 2 in Tirex)*

This priority is used by mod\_tile if a "very old" tile is requested. The configuration option ModTileVeryOldThreshold controls what counts as "very old". Unless the system load is higher than ModTileMaxLoadOld, a render request is triggered and mod\_tile waits for up to ModTileRequestTimeout seconds. If a tile is not produced within that time, the old tile is returned.

*cmdDirty (2 in mod\_tile, 10 in Tirex)*

This priority is used by mod\_tile if

- •

  the /dirty URL is manually called for a tile

- •

  an "old" or "very old" tile is requested but the load is too high to render it right  away (the old tile will be delivered instead)

- •

  a "missing" tile is requested but the load is too high to render it right away  (a 404 error will be issued)

*cmdRenderPrio (5 in mod\_tile, 1 in Tirex)*

This priority is used by mod\_tile if a "missing" tile is requested. Unless the system load is higher than ModTileMaxLoadMissing,  a render request is triggered and mod\_tile  waits for up to ModTileMissingRequestTimeout seconds. If a tile is not produced within that time, a 404 error will be issued.

*cmdRenderBulk (6 in mod\_tile, 20 in Tirex)*

Used for all "missing tile" render requests triggered by mod\_tile if "ModTileBulkMode On"  is set in the Apache configuration. In this mode, requests for old tiles are never  issued. Never used if "ModTileBulkMode Off" (the default).

*cmdRenderLow (7 in mod\_tile, 25 in Tirex)*

This priority is used by mod\_tile if an "old" tile is requested. An "old" tile is one  that is older than three days or, if a planet\_import\_complete file is present, older than this file. Unless the system load is higher than ModTileMaxLoadOld, a render  request is triggered and mod\_tile waits for up to ModTileRequestTimeout seconds. If  a tile is not produced within that time, the old tile is returned.

### $source-\>set\_request\_write\_callback(\\&wcb}

Specifies a function to be called if this source ever wants to  receive writable events.

### $source-\>notify($job)

Prepares a notification message about successful tile rendering and informs the main select loop to give us a chance to write.

### $source-\>writable($sock)

Indicates to this source that the given socket is writable.

The source will attempt to send the prepared notification message, and return STATUS\_MESSAGE\_COMPLETE if the message has been fully sent. It will return STATUS\_CONTINUE if sending needs to continue later. A return value of STATUS\_SOCKET\_CLOSED indicates that the peer has closed the  connection.
