使用Consul复制一些Eureka行为(Replication of some Eureka behaviour with Consul)
作为从尤里卡迁移到领事(Spring Cloud)的一部分,我们正在寻找复制某些行为。
其中之一就是如果一个服务在重要的情况下与Eureka断开连接,那么当它再次看到Eureka时会重新连接。
我看到服务将重试领事并最终停止。 有没有办法在服务上复制相同的行为,以便超过最大重试次数/退避次数?
只是试图支持预期的行为
As part of the move from Eureka to consul (Spring Cloud), we are looking at replicating certain behaviours.
One of them is that if a service disconnected to Eureka after a significant will reconnect when it can see Eureka again.
I see that a service will retry to consul and eventually stop. Is there a way to replicate the same behaviour on a service to consul past the max retries/backoff?
Just trying to support expected behaviours
原文:https://stackoverflow.com/questions/39253068
最满意答案
这是在wxPython-users组中发布给我的:
你无法打破“while True”循环。 你必须提供循环退出的方法:while.LoopContinue:然后,当你想要线程死亡时,你将self.sshLog1.LoopContinue设置为false。
但是,这不会结束另一个在“process.wait_for_result()”中阻塞的线程。 如果您希望它是可中断的,您也必须将其更改为循环。 但是,由于您在进程退出后没有真正做任何事情,为什么还要等它退出呢? 只是产生过程并立即返回。
- Tim Roberts,ti ... @ probo.com Providenza&Boekelheide,Inc。
This was posted to me on the wxPython-users group:
You can’t break a “while True” loop. You have to provide a way for the loop to exit: while self.LoopContinue: Then, when you want the thread to die, you set self.sshLog1.LoopContinue to false.
However, that won’t end the other thread, which is blocking in “process.wait_for_result()”. If you want that to be interruptible, you would have to change that into a loop as well. However, since you don’t really DO anything after the process exits, why do you wait for it to exit at all? Just spawn the process and return immediately.
— Tim Roberts, ti...@probo.com Providenza & Boekelheide, Inc.
相关问答
更多-
这个问题是由多线程引起的; 见上面的评论。 我已经能够通过使用这里解决的技术“切换”复选框添加到主线程:< 在Python中的线程之间共享数据 >。 虽然,这里建议一种更好的,线程安全的方法来构造我的程序:< WxPython:在TextCtrl中定期设置值不工作 >。 还有一种方法可以避免使用多个线程。 This issue is cause by utilizing multiple threads; see comments above. I have been able to "hand off" ...
-
呵呵。 根据tcaswell的评论中的讨论,我改变了 self.figure = pl.figure() 至 self.figure = matplotlib.figure.Figure() 它解决了这个问题。 (当我关闭窗口时,python退出) Huh. Per the discussion in comments from tcaswell, I changed self.figure = pl.figure() to self.figure = matplotlib.figure.Figure ...
-
wxPython GUI BoxSizers(wxPython GUI BoxSizers)[2022-05-02]
这是一个使用BoxSizers的简单示例: import wx class MyForm(wx.Frame): def __init__(self): wx.Frame.__init__(self, None, wx.ID_ANY, "Tutorial") # Add a panel so it looks the correct on all platforms panel = wx.Panel(self, wx.ID_ANY) ... -
我认为这取决于你对“富人”的定义。 我使用它,并且喜欢认为它可以制作一些相当有用的GUI。 下面是一个wxPython应用程序的屏幕截图,用于处理我正在编写的传感器数据 - 不是世界上最复杂或最复杂的传感器数据,但到目前为止,用户看起来相当直观: 我发现wxPython文档有时会有点稀疏,但只要安装了演示 文档并打开了wxWidgets文档,它就是一个很好的工具包。 I think it depends on your definition of "rich." I use it and like to t ...
-
thread.join()的任何替代方法都可以更新wxPython GUI?(Any alternative of thread.join() to update wxPython GUI?)[2022-07-18]
你想在你的线程中使用wx.CallAfter ,它将使用主线程来调用你传递的任何东西 def Downloader(a_listbox,item_index): path = a_listbox.GetItem(item_index, 0) # gets the item (first column) from list control path = path.GetText() # contains the path of the movie file # do some work ... -
如何在wxPython GUI应用程序上运行nfcpy读卡器系统(how to run nfcpy card reader system on wxPython GUI application)[2022-11-13]
nfc.ContactlessFrontend.connect()方法在调用者线程上下文中操作,因此在至少连接了一个标记之前不返回(如果'on-connect'回调返回True,它将进一步等待标记消失)。 wx.App.mainLoop()也在调用者线程上下文中运行以调度窗口事件。 因此,正确的方法是在单独的线程中运行标记发现并将事件发送到渲染帧。 下面的示例显示了标签靠近阅读器时的标签标识符。 #!/usr/bin/env python import wx import wx.lib.newevent i ... -
我需要的线索是定制表格的演示代码。 所以,这段代码的工作原理(遗漏了我的自定义逻辑,只包括裸露的骨头): def AppendCols(self, *args): msg = gridlib.GridTableMessage(self, # The table gridlib.GRIDTABLE_NOTIFY_COLS_APPENDED, # wh ...
-
这是在wxPython-users组中发布给我的: 你无法打破“while True”循环。 你必须提供循环退出的方法:while.LoopContinue:然后,当你想要线程死亡时,你将self.sshLog1.LoopContinue设置为false。 但是,这不会结束另一个在“process.wait_for_result()”中阻塞的线程。 如果您希望它是可中断的,您也必须将其更改为循环。 但是,由于您在进程退出后没有真正做任何事情,为什么还要等它退出呢? 只是产生过程并立即返回。 - Tim Ro ...
-
导出我的WxPython GUI(Export My WxPython GUI)[2023-06-17]
使用Python可执行文件创建工具。 这是最受欢迎的: py2exe pyInstaller cx_freeze bb_freeze 这些可以将您的应用程序变为可执行文件,以便最终用户不需要安装Python,wxPython或任何其他Python库。 我还建议学习如何使用安装向导(如Inno Setup或NSIS)来创建一个安装程序,使最终用户更容易使用这种东西。 我在这里写了一个如何做这种事情的例子: https://www.blog.pythonlibrary.org/2008/08/27/packag ... -
嗯,这对我有用: # -*- coding: utf-8 -*- import wx app = wx.App(redirect=False) top = wx.Frame(None) top.Maximize(False) # Set to maximize the application sizer = wx.GridBagSizer() def testFunction(event): import time for i in range(2): print ('wi ...