chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] is there any existing code for ...


From: Jörg F . Wittenberger
Subject: Re: [Chicken-users] is there any existing code for ...
Date: 22 Jun 2011 18:38:52 +0200

Hi!

I do.

I do these things on a daily basis.  And only a handful developers too.

See: www.askemos.org - it's a many years old project, which enables you
to run _almost_ arbitrary code on several machines in byzantine agreement.

What you're calling for is, what our debug level access does.

The debugger listens on a local port at your peer.
Usually I use emacs M-x telnet to connect to this port.
Once connected to the repl, there is one special command called "q"
(abbreviated "Quorum"), which takes a list of machine identifiers and
changes the current quorum of hosts simillar as "cd" changes the
current directory. All other input is sent to all the peers in the
current quorum.

((Sure there are some obstackes in the way: the remote peers in the
current quorum must be configured to accept the commands.  This boils down
to the origin peer calling via SSL and supply an appropriate certificate,
which in turn contains some attribute the remote peer is configured to
accept as authority.  The default config will just reject them.))

Originally implemented in RScheme it runs on chicken too now.
(RScheme does not run on ARM processors.  ;-)

The only difference I see wrt. to your (B) point: the repl will only
display the first result it receives, not the whole list.

/Jörg

Appendix: example session.  My commments in between start with "##:"

q g3

#<<quorum>>
##: it's the chicken's default record printer, rscheme looks different.
;;; Af4aad764b0fb48d49089dbe7880b1a03 Nu
(local-id)

"garkin3.tzv.de"
##: the DNS name differs from the host id here
;;; Af4aad764b0fb48d49089dbe7880b1a03 Nu
(+ 1 2)

3
;;; Af4aad764b0fb48d49089dbe7880b1a03 Nu
q a2

#<<quorum>>
;;; askemos2.tc-mw.de Nu
##: in contrast: here the DNS name and the host id are the same
1

1
;;; askemos2.tc-mw.de Nu
(local-id)

Exception: time out timeout ()
##: funny enough: I can show you an network outage, askemos2.tc-mw.de is
##: on DSL dial up and disconnected just between these two commands
;;; askemos2.tc-mw.de Nu
q ga
##: "ga" is just a shorthand for yet another machine

#<<quorum>>
;;; Af051fe01ba259f25aae185d500b3d6a2 Nu
(local-id)

"garkin.softeyes.net"
;;; Af051fe01ba259f25aae185d500b3d6a2 Nu
q ga g3

#<<quorum>>
;;; Af051fe01ba259f25aae185d500b3d6a2 Af4aad764b0fb48d49089dbe7880b1a03 Nu
##: now the prompt indicates that two machines will execute the command
(+ 3 4)

7
##: and I have *no* idea at all, whose result that was
;;; Af051fe01ba259f25aae185d500b3d6a2 Af4aad764b0fb48d49089dbe7880b1a03 Nu

On Jun 22 2011, HP wei wrote:

On June 21, I sent a request (titled: What would you recommend for this ?)
in which I described
a project that I am trying to do in chicken scheme.
I have looked around a bit more and I think the following two components
will be very useful
for that project.

Do you know of any relevant codes that I can
either use or use as a starting point for (A) and (B) ??

(A) On each of many machines, I would like to run a repl server which takes the input from
    a port.

In emacs, one can invoke a local chicken-repl or a remote chicken-repl.
    So, I am sure the code for the server is somewhere.
    Could someone point me to the right place ??

(B) On a master machine,  I would like to implement a function
     called net-eval.

     (net-eval  '((host-1   port-1   exp)
                    (host-2   port-2    exp) ...))

     exp (as a string) will be  sent to each repl server on host-i
     and gets executed on host-1, host-2 ...
     and the function returns the list of results from each host.

     Or
     (net-eval  '((host-1   port-1   exp)
                    (host-2   port-2    exp) ...) handler)

      handler is a function to be called whenever a result is available
from
      a host-i

     ------------------------------------------

     At this point, you may notice that (A) and (B) come from newlisp.
newlisp is some kind of script language. Personally, I don't like it.
     But I think the built-in feature of (A)(B) is newlisp is helpful for
my project.

     Anything similar to net-eval already exists in chicken scheme ?
     Or should I just need to try to port net-eval  from newlisp ??

thanks
HP





reply via email to

[Prev in Thread] Current Thread [Next in Thread]