/// <summary> /// This is the main entry point for your service instance. /// </summary> /// <param name="cancellationToken">Canceled when Service Fabric needs to shut down this service instance.</param> /// <returns>Completed task</returns> protected override async Task RunAsync(CancellationToken cancellationToken) { var connectionString = this.configuration.DefaultConnectionString; this.storageTaskScheduler = new StorageTaskScheduler(connectionString); this.storageTaskScheduler.TimerStart(); this.engine = new SocialEngine( message => ServiceEventSource.Current.ServiceMessage(this.Context, message), connectionString, this.metricManager); this.dispatcher = new RestfulDispatcher <ServiceProviderResponse>( message => ServiceEventSource.Current.ServiceMessage(this.Context, message), this); await Task.CompletedTask; }
/// <summary> /// This is the main entry point for your service instance. /// </summary> /// <param name="cancellationToken">Canceled when Service Fabric needs to shut down this service instance.</param> /// <returns>Async task</returns> protected override async Task RunAsync(CancellationToken cancellationToken) { this.controller = new OperationController( this.storeFactory, this.engine, this.configuration, this.reportManager, this.credentialManager, this.metricManager); this.storageTaskScheduler = new StorageTaskScheduler(this.reportManager); this.storageTaskScheduler.TimerStart(); this.dispatcher = new RestfulDispatcher <ServiceProviderResponse>( message => ServiceEventSource.Current.ServiceMessage(this.Context, message), this.controller); await this.billingAgent.OnRunAsync(cancellationToken); }