https://grpc.io/docs/tutorials/basic/go.html#server-side-streaming-rpc
Quoting Ricky (2018-11-05 18:02:38) > how do I make grpc return a stream? are you referring to google rpc > grpc library that is recommended by Golang folks to be used instead of > net/rpc lib which is a frozen package? Interesting ... I didn't know > they had streams.... > > On Sun, Nov 4, 2018 at 12:20 PM Ian Denhardt <[1]i...@zenhack.net> > wrote: > > What is the functionality that you're not seeing re: how to do file > downloads over net/rpc? > The thing that pops to my mind as likely important is the ability to > stream data, which you indeed cannot do with net/rpc. > If you need that I might suggest using a different rpc system that > has > the expressivity you need. e.g. with grpc you could have a method > that > returns a stream. Cap'n Proto is capable of capturing this kind of > thing > as well. > Quoting Ricky (2018-11-04 14:22:11) > >� � I am sorry I wasn't very forthcoming in the beginning - to > clarify - by > >� � rpc I meant using go net/rpc package. Where I can simply > Register > >� � methods/services that can be called remotely as if they were > >� � functions/methods locally available. This lends to a cleaner > syntax and > >� � more robust code in general from which I have built very > clean > >� � distributed systems in past. > >� � I do not use net/rpc currently - instead I have a worker > running a tcp > >� � server which understands handshakes (control flow) and I > currently move > >� � files using io copy. All this because I only have access to a > single > >� � TCP port on machine where the worker agent is hosted. The > worker is a > >� � tcp server that does io.Copy to give file to calling�� > master. > >� � This flow is a bit crummy in my opinion, there's many chances > of errors > >� � being missed perhaps, I have to do timeout handling, acking > etc which > >� � net/rpc automatically takes care off plus go rpc package > provides many > >� � primitives which I have used in past to just do all of this > kind of > >� � control flow Master calling workers to do a work a but if > work a fails > >� � or errors out, the system has a cleaner way of tracking and > telling me > >� � (via error and replies) - I wanted to use that kind of robust > ness. > >� � I suspect this kind of thing cannot be done with via go > net/rpc > >� � package... but wanted to ask upfront.... also if I were to > use scp, > >� � sftp etc can I leverage this to be done with single port > (different > >� � port than usual scp sftp ports) - this port restriction is > due to > >� � security and many other reasons ....� > > > >� � On Sun, Nov 4, 2018 at 1:09 AM Amnon Baron Cohen > <[1][2]amno...@gmail.com> > >� � wrote: > > > >� � And don't forget the bit-torrent class of solutions. > >� � On Friday, 2 November 2018 16:56:17 UTC, Tom Mitchell wrote: > > > >� � Moving files is a solved, non trivial problem .... > >� � Have you looked at tools like scp (ssh), rsync, kermit, ftp, > sftp, tftp > >� � and network filesystems (nfs and samba)? > >� � Even git and http.�� Error recover, host name lookup, > compression, > >� � restart, safe abort, transport encryption, authentication, > buffering. > >� � > [2][3]https://en.wikipedia.org/wiki/Sorcerer%27s_Apprentice_Syndrome > >� � > [3][4]https://stackoverflow.com/questions/68335/how-to-copy-a-file-t > o-a-re > >� � mote-server-in-python-using-scp-or-ssh > > > >� � On Thu, Nov 1, 2018 at 11:24 PM Tamás Gulácsi > <[5]tgula...@gmail.com> > >� � wrote: > > > >� � 2018. november 2., péntek 6:21:47 UTC+1 id�pontban Anirudh > Vyas a > >� � következ�t �rta: > > > >� � Hello there -� > >� � I am looking for example/help for using rpc to do file > downloads - I am > >� � not sure if this is possible, or recommended or if there is a > >� � better/cleaner way. I like the robust nature of RPCs and have > written a > >� � few good, performant distributed systems in them - was > hoping/wondering > >� � if I could use RPC to do downloads - I currently use > combination of > >� � io.Copy and a TCP server to do this. > > > >� � What kind of RPC ? RPC is just "Remote Procedure Call". > >� � If s `send(data []byte)` won't be enough (size restrictions), > you can > >� � copy the io interfaces: > >� � CreateFile(name, perms...) (fileHandle) > >� � WriteFile(fileHandle, chunk) > >� � CloseFile(fileHandle) > > > >� � � -- > >� � � You received this message because you are subscribed to > the Google > >� � � Groups "golang-nuts" group. > >� � � To unsubscribe from this group and stop receiving emails > from it, > >� � � send an email to [6]golang-nuts...@googlegroups.com. > >� � � For more options, visit > [4][7]https://groups.google.com/d/optout. > > > >� � � -- > > > >� � �� � T o m �� � M i t c h e l l > > > >� � � -- > >� � � You received this message because you are subscribed to > the Google > >� � � Groups "golang-nuts" group. > >� � � To unsubscribe from this group and stop receiving emails > from it, > >� � � send an email to > [5][8]golang-nuts+unsubscr...@googlegroups.com. > >� � � For more options, visit > [6][9]https://groups.google.com/d/optout. > > > >� � -- > > > >� � Vyas, Anirudh > >� � Computer Science and Math Autodidact > >� � E-Mail: [7][10]ricky...@gmail.com > >� � Mobile: � (US): 650-727-2636 > > > >� � -- > >� � You received this message because you are subscribed to the > Google > >� � Groups "golang-nuts" group. > >� � To unsubscribe from this group and stop receiving emails from > it, send > >� � an email to [8][11]golang-nuts+unsubscr...@googlegroups.com. > >� � For more options, visit > [9][12]https://groups.google.com/d/optout. > > > > Verweise > > > >� � 1. mailto:[13]amno...@gmail.com > >� � 2. > [14]https://en.wikipedia.org/wiki/Sorcerer%27s_Apprentice_Syndrome > >� � 3. > [15]https://stackoverflow.com/questions/68335/how-to-copy-a-file-to- > a-remote-server-in-python-using-scp-or-ssh > >� � 4. [16]https://groups.google.com/d/optout > >� � 5. mailto:[17]golang-nuts+unsubscr...@googlegroups.com > >� � 6. [18]https://groups.google.com/d/optout > >� � 7. mailto:[19]ricky...@gmail.com > >� � 8. mailto:[20]golang-nuts+unsubscr...@googlegroups.com > >� � 9. [21]https://groups.google.com/d/optout > > -- > > Vyas, Anirudh > Computer Science and Math Autodidact > E-Mail: [22]ricky...@gmail.com > Mobile: � (US): 650-727-2636 > > Verweise > > 1. mailto:i...@zenhack.net > 2. mailto:amno...@gmail.com > 3. https://en.wikipedia.org/wiki/Sorcerer%27s_Apprentice_Syndrome > 4. https://stackoverflow.com/questions/68335/how-to-copy-a-file-to-a-re > 5. mailto:tgula...@gmail.com > 6. mailto:golang-nuts...@googlegroups.com > 7. https://groups.google.com/d/optout > 8. mailto:golang-nuts%2bunsubscr...@googlegroups.com > 9. https://groups.google.com/d/optout > 10. mailto:ricky...@gmail.com > 11. mailto:golang-nuts%2bunsubscr...@googlegroups.com > 12. https://groups.google.com/d/optout > 13. mailto:amno...@gmail.com > 14. https://en.wikipedia.org/wiki/Sorcerer%27s_Apprentice_Syndrome > 15. > https://stackoverflow.com/questions/68335/how-to-copy-a-file-to-a-remote-server-in-python-using-scp-or-ssh > 16. https://groups.google.com/d/optout > 17. mailto:golang-nuts%2bunsubscr...@googlegroups.com > 18. https://groups.google.com/d/optout > 19. mailto:ricky...@gmail.com > 20. mailto:golang-nuts%2bunsubscr...@googlegroups.com > 21. https://groups.google.com/d/optout > 22. mailto:ricky...@gmail.com -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.