Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
StackExchange.Redis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
StackExchange.Redis
Commits
eff8123e
Commit
eff8123e
authored
Feb 13, 2015
by
Wojtek Turowicz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
provide a way of overriding the task factory which se.redis will use
parent
cd044317
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
1 deletion
+25
-1
ConnectionMultiplexer.cs
...change.Redis/StackExchange/Redis/ConnectionMultiplexer.cs
+25
-1
No files found.
StackExchange.Redis/StackExchange/Redis/ConnectionMultiplexer.cs
View file @
eff8123e
...
...
@@ -51,6 +51,30 @@ public static ConfiguredTaskAwaitable<T> ForAwait<T>(this Task<T> task)
/// </summary>
public
sealed
partial
class
ConnectionMultiplexer
:
IDisposable
{
private
static
TaskFactory
_factory
=
null
;
/// <summary>
/// Provides a way of overriding the default Task Factory. If not set, it will use the default Task.Factory.
/// Useful when top level code sets it's own factory which may interfere with Redis queries.
/// </summary>
public
static
TaskFactory
Factory
{
get
{
if
(
_factory
!=
null
)
{
return
_factory
;
}
return
Task
.
Factory
;
}
set
{
_factory
=
value
;
}
}
/// <summary>
/// Get summary statistics associates with this server
/// </summary>
...
...
@@ -738,7 +762,7 @@ private static ConnectionMultiplexer ConnectImpl(Func<ConnectionMultiplexer> mul
killMe
=
muxer
;
// note that task has timeouts internally, so it might take *just over* the regular timeout
// wrap into task to force async execution
var
task
=
Task
.
Factory
.
StartNew
(()
=>
{
return
muxer
.
ReconfigureAsync
(
true
,
false
,
log
,
null
,
"connect"
).
Result
;
});
var
task
=
Factory
.
StartNew
(()
=>
{
return
muxer
.
ReconfigureAsync
(
true
,
false
,
log
,
null
,
"connect"
).
Result
;
});
if
(!
task
.
Wait
(
muxer
.
SyncConnectTimeout
(
true
)))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment