[{"data":1,"prerenderedAt":736},["ShallowReactive",2],{"navigation":3,"\u002Fextensions\u002Fpogo":65,"\u002Fextensions\u002Fpogo-surround":731},[4,25,50],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":6},"Getting Started",false,"\u002Fgetting-started","1.getting-started",[10,15,20],{"title":11,"path":12,"stem":13,"icon":14},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F1.introduction","i-lucide-house",{"title":16,"path":17,"stem":18,"icon":19},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation","i-lucide-download",{"title":21,"path":22,"stem":23,"icon":24},"Building FrankenPHP","\u002Fgetting-started\u002Fbuilding-frankenphp","1.getting-started\u002F3.building-frankenphp","i-lucide-hammer",{"title":26,"icon":6,"path":27,"stem":28,"children":29,"page":6},"Extensions","\u002Fextensions","2.extensions",[30,35,40,45],{"title":31,"path":32,"stem":33,"icon":34},"Queue","\u002Fextensions\u002Fqueue","2.extensions\u002F1.queue","i-lucide-list-checks",{"title":36,"path":37,"stem":38,"icon":39},"Scheduler","\u002Fextensions\u002Fscheduler","2.extensions\u002F2.scheduler","i-lucide-calendar-clock",{"title":41,"path":42,"stem":43,"icon":44},"Pogo","\u002Fextensions\u002Fpogo","2.extensions\u002F3.pogo","i-lucide-split",{"title":46,"path":47,"stem":48,"icon":49},"WebSocket","\u002Fextensions\u002Fwebsocket","2.extensions\u002F4.websocket","i-lucide-radio",{"title":51,"icon":6,"path":52,"stem":53,"children":54,"page":6},"Reference","\u002Freference","3.reference",[55,60],{"title":56,"path":57,"stem":58,"icon":59},"Caddy Reference","\u002Freference\u002Fcaddy","3.reference\u002F1.caddy","i-lucide-settings-2",{"title":61,"path":62,"stem":63,"icon":64},"PHP API","\u002Freference\u002Fphp-api","3.reference\u002F2.php-api","i-lucide-file-code-2",{"id":66,"title":41,"body":67,"description":724,"extension":725,"links":726,"meta":727,"navigation":728,"path":42,"seo":729,"stem":43,"__hash__":730},"docs\u002F2.extensions\u002F3.pogo.md",{"type":68,"value":69,"toc":714},"minimark",[70,75,79,82,95,98,102,105,108,119,122,133,137,140,197,200,216,220,227,364,367,432,436,443,525,532,535,544,547,562,565,614,617,637,647,650,654,671,675,710],[71,72,74],"h2",{"id":73},"overview","Overview",[76,77,78],"p",{},"Pogo runs independent PHP jobs in FrankenPHP extension worker pools while the original request waits for their results.",[76,80,81],{},"It is useful for fan-out\u002Ffan-in work such as:",[83,84,85,89,92],"ul",{},[86,87,88],"li",{},"independent API calls,",[86,90,91],{},"independent computations,",[86,93,94],{},"response fragments that can be built in parallel.",[76,96,97],{},"Pogo is not a queue. Jobs must complete within the request lifecycle.",[71,99,101],{"id":100},"status-and-fit","Status and fit",[76,103,104],{},"Pogo is experimental. Use it for request-scoped parallelism where failures can safely fail the request or be retried by the caller.",[76,106,107],{},"Use it when:",[83,109,110,113,116],{},[86,111,112],{},"Work is independent and can run in parallel.",[86,114,115],{},"Each job is expected to finish quickly enough for an HTTP request.",[86,117,118],{},"You want separate worker pools for external APIs, CPU work, or critical paths.",[76,120,121],{},"Avoid it when:",[83,123,124,127,130],{},[86,125,126],{},"You need persistence, retry, delay, or cancellation.",[86,128,129],{},"You need a long-running task runner.",[86,131,132],{},"You need an event loop or fiber abstraction.",[71,134,136],{"id":135},"build","Build",[76,138,139],{},"Compile the module into FrankenPHP:",[141,142,148],"pre",{"className":143,"code":144,"filename":145,"language":146,"meta":147,"style":147},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","xcaddy build \\\n  --with github.com\u002Fdunglas\u002Ffrankenphp@v1.12.3 \\\n  --with github.com\u002Fdunglas\u002Ffrankenphp\u002Fcaddy@v1.12.3 \\\n  --with github.com\u002Fy-l-g\u002Fpogo\u002Fmodule@main\n","Terminal","bash","",[149,150,151,168,179,189],"code",{"__ignoreMap":147},[152,153,156,160,164],"span",{"class":154,"line":155},"line",1,[152,157,159],{"class":158},"sBMFI","xcaddy",[152,161,163],{"class":162},"sfazB"," build",[152,165,167],{"class":166},"sTEyZ"," \\\n",[152,169,171,174,177],{"class":154,"line":170},2,[152,172,173],{"class":162},"  --with",[152,175,176],{"class":162}," github.com\u002Fdunglas\u002Ffrankenphp@v1.12.3",[152,178,167],{"class":166},[152,180,182,184,187],{"class":154,"line":181},3,[152,183,173],{"class":162},[152,185,186],{"class":162}," github.com\u002Fdunglas\u002Ffrankenphp\u002Fcaddy@v1.12.3",[152,188,167],{"class":166},[152,190,192,194],{"class":154,"line":191},4,[152,193,173],{"class":162},[152,195,196],{"class":162}," github.com\u002Fy-l-g\u002Fpogo\u002Fmodule@main\n",[76,198,199],{},"Install the PHP package:",[141,201,203],{"className":143,"code":202,"filename":145,"language":146,"meta":147,"style":147},"composer require pogo\u002Fpogo\n",[149,204,205],{"__ignoreMap":147},[152,206,207,210,213],{"class":154,"line":155},[152,208,209],{"class":158},"composer",[152,211,212],{"class":162}," require",[152,214,215],{"class":162}," pogo\u002Fpogo\n",[71,217,219],{"id":218},"caddy-configuration","Caddy configuration",[76,221,222,223,226],{},"Configure Pogo as a Caddy global option. A ",[149,224,225],{},"default"," pool is required.",[141,228,233],{"className":229,"code":230,"filename":231,"language":232,"meta":147,"style":147},"language-caddyfile shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  frankenphp\n\n  pogo {\n    pool default {\n      worker public\u002Fpogo-worker.php\n      num_threads 8\n      max_wait 30s\n    }\n\n    pool external_api {\n      worker public\u002Fpogo-worker.php\n      num_threads 16\n      max_wait 10s\n    }\n\n    pool cpu {\n      worker public\u002Fpogo-worker.php\n      num_threads 4\n      max_wait 60s\n    }\n  }\n}\n","Caddyfile","caddyfile",[149,234,235,240,245,251,256,262,268,274,280,286,291,297,302,308,314,319,324,330,335,341,347,352,358],{"__ignoreMap":147},[152,236,237],{"class":154,"line":155},[152,238,239],{},"{\n",[152,241,242],{"class":154,"line":170},[152,243,244],{},"  frankenphp\n",[152,246,247],{"class":154,"line":181},[152,248,250],{"emptyLinePlaceholder":249},true,"\n",[152,252,253],{"class":154,"line":191},[152,254,255],{},"  pogo {\n",[152,257,259],{"class":154,"line":258},5,[152,260,261],{},"    pool default {\n",[152,263,265],{"class":154,"line":264},6,[152,266,267],{},"      worker public\u002Fpogo-worker.php\n",[152,269,271],{"class":154,"line":270},7,[152,272,273],{},"      num_threads 8\n",[152,275,277],{"class":154,"line":276},8,[152,278,279],{},"      max_wait 30s\n",[152,281,283],{"class":154,"line":282},9,[152,284,285],{},"    }\n",[152,287,289],{"class":154,"line":288},10,[152,290,250],{"emptyLinePlaceholder":249},[152,292,294],{"class":154,"line":293},11,[152,295,296],{},"    pool external_api {\n",[152,298,300],{"class":154,"line":299},12,[152,301,267],{},[152,303,305],{"class":154,"line":304},13,[152,306,307],{},"      num_threads 16\n",[152,309,311],{"class":154,"line":310},14,[152,312,313],{},"      max_wait 10s\n",[152,315,317],{"class":154,"line":316},15,[152,318,285],{},[152,320,322],{"class":154,"line":321},16,[152,323,250],{"emptyLinePlaceholder":249},[152,325,327],{"class":154,"line":326},17,[152,328,329],{},"    pool cpu {\n",[152,331,333],{"class":154,"line":332},18,[152,334,267],{},[152,336,338],{"class":154,"line":337},19,[152,339,340],{},"      num_threads 4\n",[152,342,344],{"class":154,"line":343},20,[152,345,346],{},"      max_wait 60s\n",[152,348,350],{"class":154,"line":349},21,[152,351,285],{},[152,353,355],{"class":154,"line":354},22,[152,356,357],{},"  }\n",[152,359,361],{"class":154,"line":360},23,[152,362,363],{},"}\n",[76,365,366],{},"Pool directives:",[368,369,370,386],"table",{},[371,372,373],"thead",{},[374,375,376,380,383],"tr",{},[377,378,379],"th",{},"Directive",[377,381,382],{},"Required",[377,384,385],{},"Description",[387,388,389,403,416],"tbody",{},[374,390,391,397,400],{},[392,393,394],"td",{},[149,395,396],{},"worker",[392,398,399],{},"Yes",[392,401,402],{},"PHP worker script.",[374,404,405,410,413],{},[392,406,407],{},[149,408,409],{},"num_threads",[392,411,412],{},"No",[392,414,415],{},"FrankenPHP worker thread count.",[374,417,418,423,425],{},[392,419,420],{},[149,421,422],{},"max_wait",[392,424,412],{},[392,426,427,428,431],{},"Maximum wait while sending a job to the worker pool. Defaults to ",[149,429,430],{},"30s",".",[71,433,435],{"id":434},"application-integration","Application integration",[76,437,438,439,442],{},"Create a job class that implements ",[149,440,441],{},"Pogo\\JobInterface",":",[141,444,449],{"className":445,"code":446,"filename":447,"language":448,"meta":147,"style":147},"language-php shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u003C?php\n\nnamespace App\\Pogo;\n\nuse Pogo\\JobInterface;\n\nfinal class FetchPrice implements JobInterface\n{\n    public function handle(array $args): mixed\n    {\n        return [\n            'sku' => $args['sku'],\n            'price' => 42,\n        ];\n    }\n}\n","app\u002FPogo\u002FFetchPrice.php","php",[149,450,451,456,460,465,469,474,478,483,487,492,497,502,507,512,517,521],{"__ignoreMap":147},[152,452,453],{"class":154,"line":155},[152,454,455],{},"\u003C?php\n",[152,457,458],{"class":154,"line":170},[152,459,250],{"emptyLinePlaceholder":249},[152,461,462],{"class":154,"line":181},[152,463,464],{},"namespace App\\Pogo;\n",[152,466,467],{"class":154,"line":191},[152,468,250],{"emptyLinePlaceholder":249},[152,470,471],{"class":154,"line":258},[152,472,473],{},"use Pogo\\JobInterface;\n",[152,475,476],{"class":154,"line":264},[152,477,250],{"emptyLinePlaceholder":249},[152,479,480],{"class":154,"line":270},[152,481,482],{},"final class FetchPrice implements JobInterface\n",[152,484,485],{"class":154,"line":276},[152,486,239],{},[152,488,489],{"class":154,"line":282},[152,490,491],{},"    public function handle(array $args): mixed\n",[152,493,494],{"class":154,"line":288},[152,495,496],{},"    {\n",[152,498,499],{"class":154,"line":293},[152,500,501],{},"        return [\n",[152,503,504],{"class":154,"line":299},[152,505,506],{},"            'sku' => $args['sku'],\n",[152,508,509],{"class":154,"line":304},[152,510,511],{},"            'price' => 42,\n",[152,513,514],{"class":154,"line":310},[152,515,516],{},"        ];\n",[152,518,519],{"class":154,"line":316},[152,520,285],{},[152,522,523],{"class":154,"line":321},[152,524,363],{},[76,526,527,528,531],{},"Create ",[149,529,530],{},"public\u002Fpogo-worker.php"," by copying the package worker or by writing a custom worker that accepts the same payload and response envelope.",[76,533,534],{},"The default worker expects:",[141,536,538],{"className":445,"code":537,"language":448,"meta":147,"style":147},"['class' => App\\Pogo\\FetchPrice::class, 'args' => ['sku' => 'A-100']]\n",[149,539,540],{"__ignoreMap":147},[152,541,542],{"class":154,"line":155},[152,543,537],{},[76,545,546],{},"and returns:",[141,548,550],{"className":445,"code":549,"language":448,"meta":147,"style":147},"['ok' => true, 'result' => $value]\n['ok' => false, 'error' => 'message']\n",[149,551,552,557],{"__ignoreMap":147},[152,553,554],{"class":154,"line":155},[152,555,556],{},"['ok' => true, 'result' => $value]\n",[152,558,559],{"class":154,"line":170},[152,560,561],{},"['ok' => false, 'error' => 'message']\n",[76,563,564],{},"Dispatch and await jobs inside a request:",[141,566,568],{"className":445,"code":567,"language":448,"meta":147,"style":147},"$price = pogo_dispatch(App\\Pogo\\FetchPrice::class, ['sku' => $sku], 'external_api');\n$stock = pogo_dispatch(App\\Pogo\\FetchStock::class, ['sku' => $sku], 'external_api');\n$tax = pogo_dispatch(App\\Pogo\\CalculateTax::class, ['sku' => $sku], 'cpu');\n\nreturn [\n    'price' => pogo_await($price, 2.0),\n    'stock' => pogo_await($stock, 2.0),\n    'tax' => pogo_await($tax, 2.0),\n];\n",[149,569,570,575,580,585,589,594,599,604,609],{"__ignoreMap":147},[152,571,572],{"class":154,"line":155},[152,573,574],{},"$price = pogo_dispatch(App\\Pogo\\FetchPrice::class, ['sku' => $sku], 'external_api');\n",[152,576,577],{"class":154,"line":170},[152,578,579],{},"$stock = pogo_dispatch(App\\Pogo\\FetchStock::class, ['sku' => $sku], 'external_api');\n",[152,581,582],{"class":154,"line":181},[152,583,584],{},"$tax = pogo_dispatch(App\\Pogo\\CalculateTax::class, ['sku' => $sku], 'cpu');\n",[152,586,587],{"class":154,"line":191},[152,588,250],{"emptyLinePlaceholder":249},[152,590,591],{"class":154,"line":258},[152,592,593],{},"return [\n",[152,595,596],{"class":154,"line":264},[152,597,598],{},"    'price' => pogo_await($price, 2.0),\n",[152,600,601],{"class":154,"line":270},[152,602,603],{},"    'stock' => pogo_await($stock, 2.0),\n",[152,605,606],{"class":154,"line":276},[152,607,608],{},"    'tax' => pogo_await($tax, 2.0),\n",[152,610,611],{"class":154,"line":282},[152,612,613],{},"];\n",[71,615,61],{"id":616},"php-api",[141,618,620],{"className":445,"code":619,"language":448,"meta":147,"style":147},"pogo_dispatch(string $class, array $args = [], string $pool = 'default'): int;\npogo_await(int $handle, float $timeout = 5.0): mixed;\npogo_pool_size(string $pool = 'default'): int;\n",[149,621,622,627,632],{"__ignoreMap":147},[152,623,624],{"class":154,"line":155},[152,625,626],{},"pogo_dispatch(string $class, array $args = [], string $pool = 'default'): int;\n",[152,628,629],{"class":154,"line":170},[152,630,631],{},"pogo_await(int $handle, float $timeout = 5.0): mixed;\n",[152,633,634],{"class":154,"line":181},[152,635,636],{},"pogo_pool_size(string $pool = 'default'): int;\n",[76,638,639,642,643,646],{},[149,640,641],{},"pogo_await()"," throws ",[149,644,645],{},"RuntimeException"," for invalid handles, timeouts, worker failures, and job exceptions.",[76,648,649],{},"Arguments and return values must be JSON-compatible. Resources, closures, cyclic data, and unserializable objects are unsupported.",[71,651,653],{"id":652},"operations","Operations",[83,655,656,659,662,668],{},[86,657,658],{},"Keep Pogo jobs short enough for the calling request timeout.",[86,660,661],{},"Use separate pools to isolate slow external APIs from CPU-heavy jobs.",[86,663,664,665,667],{},"Size ",[149,666,409],{}," according to workload type and available CPU.",[86,669,670],{},"Treat job failures as request failures unless your application handles partial results.",[71,672,674],{"id":673},"troubleshooting","Troubleshooting",[83,676,677,684,692,700],{},[86,678,679,683],{},[680,681,682],"strong",{},"Invalid or unknown job class:"," confirm the class is autoloadable inside the worker.",[86,685,686,691],{},[680,687,688,689,442],{},"Job must implement ",[149,690,441],{}," update the class or use a custom worker.",[86,693,694,699],{},[680,695,696,697,442],{},"Timeouts from ",[149,698,641],{}," increase the await timeout or reduce job runtime.",[86,701,702,705,706,709],{},[680,703,704],{},"Pool missing:"," confirm the pool is defined in the ",[149,707,708],{},"pogo"," Caddy block and the binary includes the module.",[711,712,713],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":147,"searchDepth":155,"depth":170,"links":715},[716,717,718,719,720,721,722,723],{"id":73,"depth":170,"text":74},{"id":100,"depth":170,"text":101},{"id":135,"depth":170,"text":136},{"id":218,"depth":170,"text":219},{"id":434,"depth":170,"text":435},{"id":616,"depth":170,"text":61},{"id":652,"depth":170,"text":653},{"id":673,"depth":170,"text":674},"Request-scoped parallel PHP jobs for fan-out and fan-in work.","md",null,{},{"icon":44},{"title":41,"description":724},"R5cbDtyL0CZwsgI5uj4D_KfOp97pgvwvjAsHCFayVYY",[732,734],{"title":36,"path":37,"stem":38,"description":733,"icon":39,"children":-1},"Embedded cron-style command trigger for single-binary FrankenPHP deployments.",{"title":46,"path":47,"stem":48,"description":735,"icon":49,"children":-1},"Embedded Pusher-compatible WebSocket server and Laravel broadcaster.",1779731238168]