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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var virtualBroker = new VirtualBroker(); | |
var coolStrategy = new CoolStrategy(); | |
var anotherCoolStrategy = new AnotherCoolStrategy(); | |
var graph = RunnableGraph.FromGraph(GraphDsl.Create(b => | |
{ | |
var input = b.Add(Source.From(new[] { new TickData(11, 12), new TickData(12, 13) })); //FAIL- Must be dynamic Queue |
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
class Program | |
{ | |
static ActorSystem System; | |
static int loop = 1000; | |
static int maxParallel=100;//For Parallel Foreach | |
static int taskload = 50; | |
static void Main(string[] args) | |
{ | |
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
[DependencyRegisterar(Lifetime = LifetimeManagers.PerRequest)] | |
public class RedisRepository : IRedisClientsManager, IBasicPersistenceProvider | |
{ | |
#region Members | |
private const string CONFIGURATION_PREFIX = "cfg:"; | |
private const string PERFORMANCE_PREFIX = "prf:"; | |
private const string HASHSET_PREFIX = "set:"; | |
private IRedisClientsManager _Manager; |
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
/// <summary> | |
/// Represents a lifetime manager for request base life time management | |
/// </summary> | |
public class PerRequestLifetimeManager : LifetimeManager | |
{ | |
#region Members | |
private LifetimeManager _WrappedLifetimeManager; | |
#endregion |
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
/// <summary> | |
/// Represents a context class for db operations | |
/// </summary> | |
public class DbOperationContext : IDisposable | |
{ | |
#region Members | |
private object syncRoot = new object(); | |
private int _TransactionCount; | |
private Dictionary<Type, object> _TypedClients = new Dictionary<Type, object>(); |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using System.Web.Mvc; | |
using ServiceStack.Mvc; | |
using ServiceStack.ServiceInterface.Auth; | |
using ServiceStack.ServiceInterface; | |
using ServiceStack.ServiceHost; |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using ServiceStack.ServiceInterface.Auth; | |
using ServiceStack.Text; | |
namespace ServiceStack.ServiceInterface.Auth | |
{ | |
public static class UserAuthExtensions |
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
private void ThreadedInsert(object obj) | |
{ | |
RedisClient redis = new RedisClient(TestConfig.SingleHost); | |
Article a = new Article() { Name = "I Love Writing Test" }; | |
a.Id = redis.As<Article>().GetNextSequence(); | |
redis.Watch("idx:article:" + a.Name); | |
using (var trans = redis.CreateTransaction()) | |
{ |
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
container.Register <IRep<T>>(c => new Rep<T>())); /// Exception :) | |
container.RegisterAllTypesOf<IRep> (....) |
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
public class MyProvider | |
{ | |
public IRepository MyRepository {get;set;} | |
public MyProvider() | |
{ | |
// Registration made in AppHost as container.Register<IRepository>(c => new MyRepository ()); | |
MyRepository= new Container().Resolve(IRepository); // a)Concrete Service Locator | |
MyRepository= Funq.Container.Resolve(IRepository); // b)Service Locator check this http://blog.ploeh.dk/2010/02/03/ServiceLocatorIsAnAntiPattern.aspx |