首页 \ 问答 \ 使用Consul复制一些Eureka行为(Replication of some Eureka behaviour with Consul)

使用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
更新时间:2024-04-08 18:04

最满意答案

这是在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 ...
  • 这是一个使用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 ...
  • 你想在你的线程中使用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 ...
  • 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 ...
  • 使用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 ...

相关文章

更多

最新问答

更多
  • h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
  • 创建一个功能(Create a function)
  • 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
  • PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
  • Qt冻结循环的原因?(Qt freezing cause of the loop?)
  • TableView重复youtube-api结果(TableView Repeating youtube-api result)
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
  • 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
  • 以编程方式创建UITableView(Creating a UITableView Programmatically)
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
  • Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
  • 设置kotlin扩展名(Setting a kotlin extension)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 如何在vim中启用python3?(How to enable python3 in vim?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • dedecms如何安装?
  • 在哪儿学计算机最好?
  • 学php哪个的书 最好,本人菜鸟
  • 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
  • 如何覆盖错误堆栈getter(How to override Error stack getter)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
  • 电脑高中毕业学习去哪里培训
  • 正则表达式验证SMTP响应(Regex to validate SMTP Responses)