Comparing versions 21 and 22.

Riskle Server Brainstorm

Component Requirements

  • This component will accept multiple incoming socket connections
  • This component will be able to limit the maximum number of connections it accepts
  • This component will be able to report a status of all currently active connections
  • This component will be able to fork worker processes in the background
  • This component will allow for easy forked job management
  • This component will be able to speak any tcp protocol as long as you have an adapter for it

Sub-components

The “core” server Riskle_Server should be kept as simple as possible. Thus the below-mentionned protocol would not be part of it. Instead, it’ll just instantiate workers as defined at startup,startup like:(see use cases).


$server = new Riskle_Server('127.0.0.1', 9000, 'Riskle_Server_Worker_Dummy');
$server->listen();

The protocol would be implemented into a sub package called Riskle_Server_Dynamic (name tbd), allowing the client to ask for a specific worker to be used for the job.

There could be another built-in server engine, Riskle_Server_Http, able to parse http requests and forward them through a Zend_Controller_Request_Http.

Jobs Management

The “core” server should provide an API to manage forked worker. Following operations should be available:

  • count currently active workers
  • kill a specific worker / all workers of a specific type / all workers
  • send signals to a specific worker / all workers of a certain type / all workers

It will be up to the adapters to decide how the operations will be made available to clients.

Class Reference

  • Riskle_Tcp_Server (abreviated to RTS_)
  • RTS_Adapter_Interface
  • RTS_Adapter_Abstract
  • RTS_Adapter_Standard
  • RTS_Adapter_Dynamic
  • RTS_Adapter_Http
  • RTS_Worker_Interface
  • RTS_Worker_Abstract

Use Cases

// dynamic server adapter asks client which worker they want to be used
$server = Riskle_Tcp_Server::factory('Dynamic', array(
    'address' => '127.0.0.1',
    'port' => 9000,
));
$server->listen();

$server = Riskle_Tcp_Server::factory('Http', array(
    'address' => '127.0.0.1','0.0.0.0',
    'port' => 9000,8080,
    'worker''documentRoot' => 'Riskle_Tcp_Server_Worker_Http'=>'/var/www',
));
$server->listen();

History Key

  • New content
  • Removed content

Recent Versions

Choose two versions to compare, or click the link to view it.

  1. 22. 10 months by geoffrey
  2. 21. 10 months by geoffrey
  3. 20. 10 months by geoffrey
  4. 19. 10 months by geoffrey
  5. 18. 10 months by geoffrey
  6. 17. 10 months by geoffrey
  7. 16. 10 months by geoffrey
  8. 15. 10 months by geoffrey
  9. 14. 10 months by geoffrey
  10. 13. 10 months by geoffrey
  11. 12. 10 months by geoffrey
  12. 11. 10 months by geoffrey
  13. 10. 10 months by geoffrey
  14. 9. 10 months by geoffrey
  15. 8. 10 months by geoffrey
  16. 7. 10 months by geoffrey
  17. 6. 10 months by geoffrey
  18. 5. 10 months by geoffrey
  19. 4. 10 months by geoffrey
  20. 3. 10 months by geoffrey
  21. 2. 10 months by geoffrey
  22. 1. 10 months by geoffrey