Riskle Server Brainstorm

History Key

  • New content
  • Removed content

Recent Versions

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

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

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();