Code Monkey home page Code Monkey logo

Comments (7)

corus87 avatar corus87 commented on June 26, 2024

More or less, yes. I was looking for a solution to delay a synapse and the only thing I came up with was to start thread, what would launch a synapse after a given time. The ability to delay without start a synapse is equal to the sleep neuron. I just added it because time.sleep was already needed.
Maybe I missed something and we are already able to start a synapse after a given time?

from delay-neuron.

Sispheor avatar Sispheor commented on June 26, 2024

I you use the sleep neuron in first place (first neuron of the list) it will wait before running the first task, yes.
It's not what you want?

from delay-neuron.

corus87 avatar corus87 commented on June 26, 2024

The main purpose for me was, if I go sleep, tell Kalliope to turn everything off except of a lamp in my living room what goes off after an hour. But with the sleep neuron Kalliope is sleeping and cant to do anything at this moment, the synapse delay is running as a thread so Kalliope is still functional.

from delay-neuron.

Sispheor avatar Sispheor commented on June 26, 2024

Oh ok! I see. Nice idea. You should update your doc to explain this then !
Maybe this could be integrated into the sleep neuron. To provide both behavior. This a flag to select one or the other.

from delay-neuron.

corus87 avatar corus87 commented on June 26, 2024

Like you see Im not good in explain something especially in English :) I was hopping it would be clear with the synapse example and the comment that it would run as thread. But yes I would update the docs then.
But I also think it would be better a default option for the sleep neuron.

from delay-neuron.

Sispheor avatar Sispheor commented on June 26, 2024

Ok, I looked at the code. you use a subprocess to call a new instance of kallioe with kalliope start --run-synapse which is not a good idea.
Anyway, I'll keep in mind the idea of the concept and I will see if we can implement it natively in the sleep neuron.

from delay-neuron.

corus87 avatar corus87 commented on June 26, 2024

This was my first neuron I wrote and basically I just took the Async shell from the shell neuron and removed the stuff I don´t needed. So no big deal, but it worked the last few months and I thought, why not share.

Now I have some more experience with python and the code of Kalliope whereby I would probably try to use the SynapaseLauncher directly instead of calling the shell. But I think that´s what you mean with "implement it natively"?
Anyway, when I will PR my other neuron I will leave this one out.

from delay-neuron.

Related Issues (1)

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.