forked from EasyNetQ/EasyNetQ
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow injection of custom implementation of IPersistentConnection (Ea…
…syNetQ#614) * added the PersistentConnectionFactory * updated version.cs
- Loading branch information
Showing
7 changed files
with
47 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace EasyNetQ | ||
{ | ||
public interface IPersistentConnectionFactory | ||
{ | ||
IPersistentConnection CreateConnection(); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace EasyNetQ | ||
{ | ||
public class PersistentConnectionFactory : IPersistentConnectionFactory | ||
{ | ||
private readonly IEventBus eventBus; | ||
private readonly IConnectionFactory connectionFactory; | ||
private readonly IEasyNetQLogger logger; | ||
|
||
public PersistentConnectionFactory(IEasyNetQLogger logger, IConnectionFactory connectionFactory, IEventBus eventBus) | ||
{ | ||
this.logger = logger; | ||
this.connectionFactory = connectionFactory; | ||
this.eventBus = eventBus; | ||
} | ||
|
||
public IPersistentConnection CreateConnection() | ||
{ | ||
return new PersistentConnection(connectionFactory, logger, eventBus); | ||
} | ||
} | ||
} |
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