Tip for my app

blov · · 603 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>Hello, I am working on a app which consists of a UI and this &#34;detached&#34; daemon running on a raspberry pi. I want the daemon to be controlled remotely. To achieve this I thought of:</p> <ul> <li>API that will be polled every once in a while to know what the daemon has to do</li> <li>The daemon should be running forever and call the api/execute the instructions</li> </ul> <p>Does this make sense? How can I build something like this in go? Does it make sense to have a forever-running daemon or should I have a cron entry that triggers the program?</p> <p>Is it possible to have a cli through which you can retrieve the command, and then run another go program that executes this command?</p> <p>What can I research? How do you design this kind of stuff?</p> <hr/>**评论:**<br/><br/>slabgorb: <pre><p>This may be helpful for this scenario: <a href="https://golang.org/pkg/net/rpc/" rel="nofollow">https://golang.org/pkg/net/rpc/</a></p></pre>ask: <pre><p>What the thing does, how often it talks and what other constraints or requirements you have makes a difference for what the right answer is.</p> <p>It sounds like you are just starting out though, so ... just get typing and try it out. It can work and if it&#39;s not quite the right solution in the end, you&#39;ll for sure have learned a bunch and will have some empirical experience to apply next time you are trying to match a solution to your problem.</p></pre>LC2712: <pre><p>Hi, how often it talks really depends. The ideal scenario is to have a node (for example) app sending commands (json) to the remote raspberry pi, so it doesn&#39;t have to check itself. It might be the case to have a socket, but not sure.</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

603 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传