18 lines
No EOL
575 B
PHP
18 lines
No EOL
575 B
PHP
<?php
|
|
|
|
// Import everything
|
|
require 'ncc';
|
|
require __DIR__ . DIRECTORY_SEPARATOR . 'ExampleClass.php';
|
|
import('net.nosial.tamerlib');
|
|
|
|
// Initialize TamerLib
|
|
\TamerLib\tm::initialize(\TamerLib\Enums\TamerMode::WORKER);
|
|
|
|
// Register the functions
|
|
$example_class = new ExampleClass();
|
|
\TamerLib\tm::addFunction('sleep', [$example_class, 'sleep']);
|
|
\TamerLib\tm::addFunction('pi', [$example_class, 'pi']);
|
|
\TamerLib\tm::addFunction('throwException', [$example_class, 'throwException']);
|
|
|
|
// Run the worker
|
|
\TamerLib\tm::run(); |