Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Same neuron as sleep? #1

Closed
Sispheor opened this issue Jul 13, 2017 · 7 comments
Closed

Same neuron as sleep? #1

Sispheor opened this issue Jul 13, 2017 · 7 comments

Comments

@Sispheor
Copy link

Looks like the ame as the offical "sleep" neuron. Doesn't it?

@corus87
Copy link
Owner

corus87 commented Jul 13, 2017

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?

@Sispheor
Copy link
Author

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?

@corus87
Copy link
Owner

corus87 commented Jul 13, 2017

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.

@Sispheor
Copy link
Author

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.

@corus87
Copy link
Owner

corus87 commented Jul 13, 2017

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.

@Sispheor
Copy link
Author

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.

@corus87
Copy link
Owner

corus87 commented Jul 13, 2017

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.

@corus87 corus87 closed this as completed Oct 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants