Git Product home page Git Product logo

antnest's People

Contributors

bitdeli-chef avatar mtahmed avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

cthlo

antnest's Issues

Detail the serialization/deserialization in the docs somewhere!

Currently it's ambiguous and there might be caveats that are not easily decipherable from the code.

For example currently, only classes that have the init arguments "stored" in them as attributes are "properly" serialized and deserialized because those attributes are used for initialization. This should be documented somewhere.

TODO: We should allow not storing the init arguments and instead allow creating empty objects with attributes injected later. This would require e.g. having no mandatory arguments etc. or using some trickery to bypass init by call new directly etc. (NOT IDEAL!)

Properly shutdown all threads with SIGTERM

$ python commands/start_master.py
2013-11-16 05:56:17 MESSENGER: Receiver up!
2013-11-16 05:56:17 MESSENGER: Sender up!
^C
Traceback (most recent call last):
  File "commands/start_master.py", line 26, in <module>
    start_master()
  File "commands/start_master.py", line 18, in start_master
    this_node.worker()
  File "/home/mtahmed/repos/antnest/master.py", line 69, in worker
    time.sleep(2)
KeyboardInterrupt
^C
Exception KeyboardInterrupt: KeyboardInterrupt() in <module 'threading' from '/usr/lib/python3.3/threading.py'> ignored

Threads don't shutdown properly on ^C. A solution would be to implement a stop() method in the Node classes.

Merge commands/* into one control script

Right now there are a number of scripts like start_slave.py, start_master.py and so on. Merge them into one antnest script which does all of the actions above.

It could be used e.g. like this:

antnest start-slave -p 33311

OR

antnest create-job -j jobs/reverse_strings.py

Add the notion of messenger hooks. Hooks can e.g. compress outgoing messages, encrypt, verify signatures and so on.

I had the idea for this a long time ago but I was more focused on getting the system more architecturally sound before moving to other use-case "features".

This is (roughly) how it work work:

In Master:

messenger = Messenger()
messenger.add_hooks(Compress, Encrypt)

The hooks will be applied in that order ... first Compress and then Encrypt.

In Messenger:

def add_hooks(hooks):
    for hook in hooks:
        self.hooks.append(hook())

def send(msg):
    ...
    for hook in self.hooks:
        msg = hook.apply(msg)
    ...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.