]> gitweb.factorcode.org Git - factor.git/commitdiff
stomp.cli: simplify clean-linux-x86-32 clean-linux-x86-64 clean-macosx-x86-64 main master
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 9 May 2024 22:07:56 +0000 (15:07 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 9 May 2024 22:07:56 +0000 (15:07 -0700)
extra/stomp/cli/cli.factor

index b6742d4aa67132a0259df3d24844c23296a86aa2..ef9d75ce1afb0dc3cb03b4c7f73e1c9a76a948c1 100644 (file)
@@ -67,15 +67,13 @@ CONSTANT: COMMANDS {
 ! XXX: when disconnected, exit with a message
 ! XXX: print incoming and outgoing messages nicely
 
-TUPLE: stomp-command-loop < command-loop ;
-
-M: stomp-command-loop run-command-loop
+: start-stomp-client ( -- )
     [
         stomp-host get resolve-host [ ipv4? ] filter random
         stomp-port get with-port utf8 [
             stomp-mailbox [ [ nl . flush ] with-global ] stomp-loop
         ] with-client
-    ] in-thread call-next-method ;
+    ] in-thread ;
 
 : stomp-options ( args -- )
     [
@@ -89,10 +87,9 @@ M: stomp-command-loop run-command-loop
 
 : stomp-main ( -- )
     command-line get stomp-options
-    "Welcome to STOMP!" "STOMP>"
-    stomp-command-loop new-command-loop
+    "Welcome to STOMP!" "STOMP>" <command-loop>
     COMMANDS [ over add-command ] each
-    run-command-loop ;
+    start-stomp-client run-command-loop ;
 
 MAIN: stomp-main