Commits

Ginés Martínez Sánchez committed 2960385 Draft

renamed run_forever to start. I prefer the threads sintax.

  • Participants
  • Parent commits b14e340

Comments (0)

Files changed (16)

File ginsfsm/examples/essential_gobjs/ongconnex.py

         url2=args.url2,
     )
     try:
-        ga.run_forever()
+        ga.start()
     except (KeyboardInterrupt, SystemExit):
         print('Program stopped')

File ginsfsm/examples/essential_gobjs/ongsock.py

         url=args.url,
     )
     try:
-        ga.run_forever()
+        ga.start()
     except (KeyboardInterrupt, SystemExit):
         print('Program stopped')

File ginsfsm/examples/essential_gobjs/ontimer.py

         seconds=args.seconds,
         command=''.join(args.command) or 'ls')
     try:
-        ga.run_forever()
+        ga.start()
     except (KeyboardInterrupt, SystemExit):
         print('Program stopped')

File ginsfsm/examples/essential_gobjs/stress_client_echo.py

     )
 
     try:
-        ga_cli.run_forever()
+        ga_cli.start()
     except (KeyboardInterrupt, SystemExit):
         from ginsfsm.c_sock import close_all_sockets
         close_all_sockets(ga_cli._socket_map)

File ginsfsm/examples/essential_gobjs/stress_connections.py

         )
 
         try:
-            ga_cli.run_forever()
+            ga_cli.start()
         except (KeyboardInterrupt, SystemExit):
             ga_srv.stop()
             srv_worker.join()
         )
 
         try:
-            ga_cli.run_forever()
+            ga_cli.start()
         except (KeyboardInterrupt, SystemExit):
             ga_srv.stop()
             srv_worker.join()

File ginsfsm/examples/essential_gobjs/stress_server_echo.py

     )
 
     try:
-        ga_srv.run_forever()
+        ga_srv.start()
     except (KeyboardInterrupt, SystemExit):
         print('Program stopped')

File ginsfsm/examples/http/simple_http_server.py

     )
 
     try:
-        ga_srv.run_forever()
+        ga_srv.start()
     except (KeyboardInterrupt, SystemExit):
         print('Program stopped')

File ginsfsm/examples/router/test_router.py

     }
     ga = gaplic1({}, **local_conf)
     try:
-        ga.run_forever()
+        ga.start()
     except (KeyboardInterrupt, SystemExit):
 
         # stop the gaplic

File ginsfsm/examples/sockjs/test_sockjs_server.py

     )
 
     try:
-        ga.run_forever()
+        ga.start()
     except (KeyboardInterrupt, SystemExit):
         print('Program stopped')

File ginsfsm/examples/wsgi/multiple_wsgi_server.py

     ga = main({}, **local_conf)
 
     try:
-        ga.run_forever()
+        ga.start()
     except (KeyboardInterrupt, SystemExit):
         print('Program stopped')

File ginsfsm/examples/wsgi/simple_wsgi_server.py

     ga = main({}, **local_conf)
 
     try:
-        ga.run_forever()
+        ga.start()
     except (KeyboardInterrupt, SystemExit):
         print('Program stopped')

File ginsfsm/gaplic.py

 * :meth:`GAplic.unsubscribe_event_from_external_gaplic`
 * :meth:`GAplic.unsubscribe_event_from_external_role`
 * :meth:`GAplic.add_callback`
-* :meth:`GAplic.run_forever`
+* :meth:`GAplic.start`
 * :meth:`GAplic.stop`
 * :meth:`GAplic.mt_subprocess`
 
         unsubscribe_event_from_external_gaplic,
         unsubscribe_event_from_external_role,
         add_callback,
-        run_forever,
+        start,
         stop,
         mt_subprocess
 
 
     try:
         # run the main gaplic as main process
-        ga_cli.run_forever()
+        ga_cli.start()
 
     except (KeyboardInterrupt, SystemExit):
         # stop the main gaplic
             ga = GAplic(name='Example1')
             ga.create_gobj('test_aplic', GPrincipal, None)
             try:
-                ga.run_forever()
+                ga.start()
             except KeyboardInterrupt:
                 print('Program stopped')
 
 
         return remain
 
-    def run_forever(self):
+    def start(self):
         """ Run the infinite i/o event loop.
         """
         while True:
 
         Run the gaplic loop in a separate thread.
         """
-        self.gaplic.run_forever()
+        self.gaplic.start()
 
     def stop(self):
         """ Stop the worker.
 
         Run the gaplic loop in a separate process.
         """
-        self.gaplic.run_forever()
+        self.gaplic.start()
 
     def stop(self):
         """ Stop the worker.

File ginsfsm/scripts/gconsole.py

     )
 
     try:
-        ga.run_forever()
+        ga.start()
     except (KeyboardInterrupt, SystemExit):
         print('Program stopped')
 

File ginsfsm/scripts/gserve.py

 
         def serve():
             try:
-                app.run_forever()
+                app.start()
             except (SystemExit, KeyboardInterrupt) as e:
                 if self.verbose > 1:
                     raise

File ginsfsm/tests/test_gaplic1.py

         ret = self.principal.send_event(self.principal, 'EV_QUERY', data=data)
         self.assertEqual(ret, None)
         self.assertEqual(len(self.principal.dl_query), 1)
-        #self.gaplic.run_forever()
+        #self.gaplic.start()
         self.gaplic._loop()
         self.gaplic._loop()
         state = self.principal.get_current_state()
         self.assertEqual(state, 'ST_IDLE')
         self.assertEqual(len(self.principal.dl_query), 1)
-        #self.gaplic.run_forever()
+        #self.gaplic.start()
         self.gaplic._loop()
         self.gaplic._loop()
         self.assertEqual(len(self.principal.dl_query), 0)

File ginsfsm/tests/test_timer.py

     ga = MyGAplic('TestGAplic')
     ga.create_gobj('principal', GPrincipal, None)
     try:
-        ga.run_forever()
+        ga.start()
     except KeyboardInterrupt:
         print('Program stopped')