首页 \ 问答 \ CompletableFuture.exceptionally with executor(CompletableFuture.exceptionally with executor)

CompletableFuture.exceptionally with executor(CompletableFuture.exceptionally with executor)

CompletableFuture.exceptionally()方法采用lambda,但是没有采用自定义Executor的方法,甚至是它的“... Async”风格。

哪个执行者特别执行lambda运行? 它是否与运行原始CompletableFuture的同一执行者抛出异常? 或者(如果是这种情况我会感到惊讶)是commonPool吗?


CompletableFuture.exceptionally() method takes a lambda, but there is no flavor of the method that takes a custom Executor, or even an "...Async" flavor of it.

Which executor does exceptionally lambda run on? Would it be the same executor which ran the original CompletableFuture which threw the exception? Or (I would be surprised if this is the case) is it the commonPool ?


原文:https://stackoverflow.com/questions/38254268
更新时间:2023-03-29 15:03

最满意答案

你不能将长度(3)添加到变量中,因为Visual Studio会唠叨:

预期的标识符。

但你可以这样做:

Public Shared Property MyString As String() = New String() { "abc", "def", "ghi"}

You cannot add the length (3) to your variable, because Visual Studio will nag:

Identifier expected.

But you can do something like:

Public Shared Property MyString As String() = New String() { "abc", "def", "ghi"}

相关问答

更多
  • 在Visual Basic 10和Visual Basic 9中,对类型推断的数组初始值设定支持进行了更改。 在以前的VB版本中,需要将空的参数表示为一个数组。 另外,除非另有说明,否则它会将该数组定义为对象数组: ' Integer array Dim i as Integer() = {1, 2, 3, 4} ' Object array Dim o() = {1, 2, 3} 查看更多信息: Visual Basic 2010重大更改 Visual Basic 2010中的集合和数组初始化器 ...
  • 没有区别。 规格 (2003规格,但2010规格相同,可在此下载)的引用: 数组类型通过向现有类型名称添加修饰符来指定。 通过在变量名称上放置数组类型修饰符或数组初始化修饰符,也可以将变量声明为数组类型。 为了清楚起见,在同一个声明中对变量名和类型名都有数组类型修饰符是无效的 。 下面是来自规格的示例,其中显示了所有选项: Module Test Sub Main() Dim a1() As Integer ' Declares 1-dimensional array of i ...
  • 您的C ++ / CLI代码需要如下所示声明数组(请注意'%'符号): void TestReplaceArray(array ^%IPInfoArray) 在这篇文章中也提到过: ^符号在C ++ / CLI代码中传递的参数中是否替换了C#的“ref”? Your C++/CLI code needs to declare the array as below (note the '%' symbol): void TestReplaceArray(array
  • 你不能将长度(3)添加到变量中,因为Visual Studio会唠叨: 预期的标识符。 但你可以这样做: Public Shared Property MyString As String() = New String() { "abc", "def", "ghi"} You cannot add the length (3) to your variable, because Visual Studio will nag: Identifier expected. But you can do some ...
  • 我终于找到了解决方案: http://www.pcreview.co.uk/forums/using-webclient-webrequest-webresponse-post-postdata-and-get-result-t1222629.html I finally found the solution here: http://www.pcreview.co.uk/forums/using-webclient-webrequest-webresponse-post-postdata-and-get- ...
  • VB.NET不支持控件数组,与VB6的意义相同。 不过,你可以做类似的事情。 例如,如果要使用相同的方法处理来自多个控件的事件,可以这样做: Private Sub MyClickHandler(sender As Object, e As EventArgs) Handles _ Button1.Click, _ Button2.Click, _ Button3.Click Dim buttonThatWasClicked As Button = CType(sender ...
  • 将方法声明更改为: Public Sub Func( a(,,) As Short ) 请注意,您通常不需要在VB.NET中使用ByRef关键字作为参数,因为它隐含在所有引用类型(例如数组)中。 此外,VB.NET中的典型样式约定是将TitleCase用于所有语言关键字和方法,并将camelCase用于字段,本地和参数。 (出于好奇,如果你手工转换它,你为什么选择选择VB.NET而不是C#?) Change your method declaration to this: Public Sub Func( ...
  • 您可以使用Dictionary ,但.NET 中的数组是引用类型 ,因此您需要小心如何填充字典,如果您真的想要在每个项目中使用不同的数据,则不要重复使用相同的数组。 例如 ' Create a dictionary from string to array of string Dim x = New Dictionary(Of String, String())() x("A") = New String() { "A1", "A2", "A3" } ' A : A1, A2, A3 x("A")(1) = ...
  • 您可以在VB 10和C#中使用自动实现的属性,两者都会比您显示的C#更短: public string Stub { get; set; } Public Property Stub As String 对于非平凡的属性,这听起来像是你可以放弃将所有内容放在VB中的一行 - 但是因为它有点冗长,我怀疑你最终会得到一个很长的行,损害可读性...... You can use automatically implemented properties in both VB 10 and C#, both of ...
  • 不是我所知道的。 正如Max所说,您可以安装Express版本并在本地试用。 如果您仍想使用公共数据库进行测试,请在shobankr [at] gmail.com删除平均电子邮件..我有一个公共数据库,我用它来测试我的应用程序。 Not one I am aware of. As Max said you can install Express edition and try it out locally. If you still want to test with a public DB then dr ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。