Share a ruby-session

Hello,

how can I share a ruby-process?
2 irb-sessions accessing the same Ruby-process? - so fork cant do for that.
I want to havwe one irb running the program,
whereas I could show the vars at runtime in the other session.
How can I do that?

thanks
Opti

Hi,

you can try DRb <http://ruby-doc.org/stdlib-2.3.1/libdoc/drb/rdoc/DRb.html>,
it is a part of ruby's standard library.

···

2016-11-12 3:33 GMT+02:00 Die Optimisten <inform@die-optimisten.net>:

Hello,

how can I share a ruby-process?
2 irb-sessions accessing the same Ruby-process? - so fork cant do for that.
I want to havwe one irb running the program,
whereas I could show the vars at runtime in the other session.
How can I do that?

thanks
Opti

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>

Please forgive the semi-ignorance of another newbie, but is this not the primary reason for the marshal module? I know it is used as a way of providing persistence of data, but I thought it's main intent was to provide a way of sharing data between classes and/or modules?
If this is the case why re-invent the wheel? Unless, of course, it is difficult to use for this purpose.

···

On 12/11/2016 1:33 AM, Die Optimisten wrote:

Hello,

how can I share a ruby-process?
2 irb-sessions accessing the same Ruby-process? - so fork cant do for that.
I want to havwe one irb running the program,
whereas I could show the vars at runtime in the other session.
How can I do that?

thanks
Opti

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>

-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2016.0.7859 / Virus Database: 4664/13399 - Release Date: 11/12/16

--
Patrick Bayford Tel : 020 8265 8376 E-mail : pbayford@talktalk.net

Take a look at pry-remote.

It doesn't quite do what you want, as it doesn't permit multiple remote
sessions, but the code isn't very long, and is easy to read. My hunch is
that you could use it as a starting point, and with a little work, you
could have it permitting multiple simultaneous sessions.

Kirk Haines

Just note , it has really poor performance and when we tried to use it for prod, it made the whole program hang .

After testing a few stuff , we used redis to share data , you can marshal objects before sending them to redis.

You can also try using stuff like 0mq , msgpack , etc..

http://www.aqua-mail.com

···

Sent with AquaMail for Android

On November 12, 2016 12:33:35 PM Michael Lutsiuk <michael.lutsiuk@gmail.com> wrote:

Hi,

you can try DRb<http://ruby-doc.org/stdlib-2.3.1/libdoc/drb/rdoc/DRb.html>, it is a part of ruby's standard library.

2016-11-12 3:33 GMT+02:00 Die Optimisten <inform@die-optimisten.net<mailto:inform@die-optimisten.net>>:
Hello,

how can I share a ruby-process?
2 irb-sessions accessing the same Ruby-process? - so fork cant do for that.
I want to havwe one irb running the program,
whereas I could show the vars at runtime in the other session.
How can I do that?

thanks
Opti

Quoting Bar Hofesh (bar.hofesh@safe-t.com):

   Just note , it has really poor performance and when we tried to use it for
   prod, it made the whole program hang .

Mah. I now mostly use Mruby. When I used MRI, DRb was often involved,
and proved solid & fit for the task. I had to learn its quirks
(calling remote methods does not automatically mean sharing data
between local and remote instances of objects). But I do not remember
associating it with hangs and crashes.

Carlo

···

Subject: Re: share a ruby-session
  Date: sab 12 nov 16 10:51:45 +0000

--
  * Se la Strada e la sua Virtu' non fossero state messe da parte,
* K * Carlo E. Prelz - fluido@fluido.as che bisogno ci sarebbe
  * di parlare tanto di amore e di rettitudine? (Chuang-Tzu)

How did you use it? How can we know the issue was in DRb and not in your code?

Cheers

robert

···

On Sat, Nov 12, 2016 at 11:51 AM, Bar Hofesh <bar.hofesh@safe-t.com> wrote:

Just note , it has really poor performance and when we tried to use it for
prod, it made the whole program hang .

--
[guy, jim, charlie].each {|him| remember.him do |as, often| as.you_can
- without end}
http://blog.rubybestpractices.com/

peer.​

···

On 13 November 2016 at 09:09, Patrick Bayford <pbayford@talktalk.net> wrote:

Please forgive the semi-ignorance of another newbie, but is this not the
primary reason for the marshal module? I know it is used as a way of
providing persistence of data, but I thought it's main intent was to
provide a way of sharing data between classes and/or modules?
If this is the case why re-invent the wheel? Unless, of course, it is
difficult to use for this purpose.

​Marshall lets you share data, but doesn't let you invoke methods in your

--
  Matthew Kerwin
  http://matthew.kerwin.net.au/

OK - thanks for that Matthew. Have no experience in multi-session, so would not have been aware of that. Will file away for reference.

···

On 13/11/2016 11:35 PM, Matthew Kerwin wrote:

On 13 November 2016 at 09:09, Patrick Bayford <pbayford@talktalk.net > <mailto:pbayford@talktalk.net>> wrote:

    Please forgive the semi-ignorance of another newbie, but is this
    not the primary reason for the marshal module? I know it is used
    as a way of providing persistence of data, but I thought it's main
    intent was to provide a way of sharing data between classes and/or
    modules?
    If this is the case why re-invent the wheel? Unless, of course, it
    is difficult to use for this purpose.

​Marshall lets you share data, but doesn't let you invoke methods in your peer.​

--
  Matthew Kerwin
http://matthew.kerwin.net.au/

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>

No virus found in this message.
Checked by AVG - www.avg.com <http://www.avg.com>
Version: 2016.0.7859 / Virus Database: 4664/13405 - Release Date: 11/13/16

--
Patrick Bayford Tel : 020 8265 8376 E-mail : pbayford@talktalk.net