示例#1
0
文件: Api.cs 项目: pkese/Orleankka
 public Api(
     IObserverCollection observers,
     IApiWorker worker,
     IActorRuntime runtime = null)
     : base(runtime)
 {
     this.observers = observers;
     this.worker    = worker;
 }
示例#2
0
文件: Api.cs 项目: mbernard/Orleankka
 public Api(
     string id,
     IActorRuntime runtime,
     IObserverCollection observers,
     IApiWorker worker)
     : base(id, runtime)
 {
     this.observers = observers;
     this.worker    = () => worker;
 }
示例#3
0
 public Api(
     string id,
     IActorSystem system,
     ITimerService timers,
     IObserverCollection observers,
     IApiWorker worker)
     : base(id, system)
 {
     this.timers    = timers;
     this.observers = observers;
     this.worker    = () => worker;
 }
        public UpdateDatabaseTask()
        {
            string connectionString = @"Data Source=VLAD191100\VLAD191100;Database=HyperWallet;User ID=vlad191100;Password=Vlad18201111;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False";
            DbContextOptionsBuilder <Context> options = new DbContextOptionsBuilder <Context>();

            options.UseSqlServer(connectionString);
            Context context = new Context(options.Options);

            _databaseUserWorker    = new UserDatabaseWorker(context);
            _apiUserWorker         = new UserApiWorker();
            _databasePaymentWorker = new PaymentDatabaseWorker(context);
            _apiPaymentWorker      = new PaymentApiWorker();
        }
示例#5
0
 public ApiChannel(IApiWorker worker)
 {
     worker.Channel = this;
     _thread        = new Thread(new ParameterizedThreadStart(delegate(object evt)
     {
         IApiWorker w = (IApiWorker)evt;
         w.Run();
     }));
     _thread.SetApartmentState(ApartmentState.STA);
     _thread.IsBackground = true;
     worker.ThreadId      = _thread.ManagedThreadId;
     _worker = worker;
     _thread.Start(_worker);
 }
示例#6
0
 void On(Activate _)
 {
     observers = observers ?? new ObserverCollection();
     worker    = worker ?? ApiWorkerFactory.Create(Id);
 }
 public UserService(Context context)
 {
     _databaseWorker = new UserDatabaseWorker(context);
     _apiWorker      = new UserApiWorker();
 }
 public PaymentService(Context context)
 {
     _databaseWorker = new PaymentDatabaseWorker(context);
     _apiWorker      = new PaymentApiWorker();
 }