Upgrade to Pro — share decks privately, control downloads, hide ads and more …

summon_process - orchestrating processes

summon_process - orchestrating processes

Presentation on Python library for orchestrating processes.
Fork it at: https://github.com/mlen/summon

Mateusz Lenik

August 06, 2013
Tweet

More Decks by Mateusz Lenik

Other Decks in Programming

Transcript

  1. problems •the processes need to be started •sometimes they rely

    on each other •they may need some time to boot
  2. orchestrate |ˈɔːkɪstreɪt| verb [ with obj. ] 2 plan or

    coordinate the elements of (a situation) to produce a desired effect, especially surreptitiously: the situation has been orchestrated by a tiny minority.
  3. summon_process •my first Python library •layer of orchestration for processes

    •simple interface •provides executors and orchestrators
  4. Interface •every executor takes the arguments via constructor •every execotor

    has start method •every executor has stop method •start method waits for the process to be ready
  5. Interface •every executor takes the arguments via constructor •every execotor

    has start method •every executor has stop method •start method waits for the process to be ready •same goes for orchestrators
  6. Executors •creates a process •blocks until the process is ready

    •multiple flavours •SimpleExecutor •OutputCoordinatedExecutor
  7. Executors •creates a process •blocks until the process is ready

    •multiple flavours •SimpleExecutor •OutputCoordinatedExecutor •TCPCoordinatedExecutor
  8. Executors •creates a process •blocks until the process is ready

    •multiple flavours •SimpleExecutor •OutputCoordinatedExecutor •TCPCoordinatedExecutor •HTTPCoordinatedExecutor
  9. def test_something_else(self): srv = TCPCoordinatedExecutor( 'command', host='...', port=...) cli =

    OutputCoordinatedExecutor( 'command', banner='...') with orchestrated(srv, cli): # do something
  10. How to add an executor •create a class (optionally inherit

    from executor) •accept parameters via constructor
  11. How to add an executor •create a class (optionally inherit

    from executor) •accept parameters via constructor •define start method that blocks
  12. How to add an executor •create a class (optionally inherit

    from executor) •accept parameters via constructor •define start method that blocks •define stop method
  13. How to add an executor •create a class (optionally inherit

    from executor) •accept parameters via constructor •define start method that blocks •define stop method •that's all