-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docs about TimeoutException thrown in consumer using HTTPClient. (#…
- Loading branch information
1 parent
652207c
commit 11127e2
Showing
6 changed files
with
58 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,32 @@ | ||
using System; | ||
using System.Net.Http; | ||
using System.Threading.Tasks; | ||
using DotNetCore.CAP; | ||
|
||
namespace Sample.ConsoleApp | ||
{ | ||
public class EventSubscriber : ICapSubscribe | ||
{ | ||
[CapSubscribe("sample.console.showtime")] | ||
public void ShowTime(DateTime date) | ||
public async Task ShowTime(DateTime date) | ||
{ | ||
Console.WriteLine(date); | ||
|
||
string baseAddress = "http://localhost:8080/"; | ||
var client = new HttpClient() | ||
{ | ||
BaseAddress = new Uri(baseAddress), | ||
Timeout = TimeSpan.FromMilliseconds(10) | ||
}; | ||
//try | ||
//{ | ||
var s = await client.GetAsync(baseAddress); | ||
//} | ||
//catch (Exception e) | ||
//{ | ||
// Console.WriteLine(e.Message); | ||
// Console.WriteLine(e.InnerException.Message); | ||
//} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters