private static void StartBackgroundService() { //Monitoring notifications every minute BackgroundAggregatorService.Add(() => new PeriodicMonitoringService(1)); //Start Background Service BackgroundAggregatorService.StartBackgroundService(); }
private static void StartBackgroundService() { //Atualiza o RSS a cada 1 Minuto BackgroundAggregatorService.Add(() => new PeriodicRSSFeedService(1)); //Inicia o Background Service BackgroundAggregatorService.StartBackgroundService(); }
private static void StartBackgroundService() { // Register Periodic Tasks BackgroundAggregatorService.Add(() => new PeriodicService()); // Start the background service BackgroundAggregatorService.StopBackgroundService(); // Fix for error if already running. UWP Cannot create a file when that file already exists. BackgroundAggregatorService.StartBackgroundService(); }
private static void StartBackgroundService() { //Rss gets updated every 3 minutes BackgroundAggregatorService.Add(() => new PeriodicBBCNewsRssFeed(3)); //BackgroundAggregatorService.Add(() => new PeriodicCNNRssFeed(4)); BackgroundAggregatorService.Add(() => new PeriodicWashingtonPostRssFeed(5)); //you now running the periodic task in the background BackgroundAggregatorService.StartBackgroundService(); }
protected override void OnSleep() { // Handle when your app sleeps //BackgroundAggregatorService.StopBackgroundService(); //Register Periodic Tasks BackgroundAggregatorService.Add(() => new PeriodicWebCall(3)); //BackgroundAggregatorService.Add(() => new PeriodicCall2(4)); //Start the background service BackgroundAggregatorService.StartBackgroundService(); }
protected override void OnResume() { try { // Handle when your app resumes //Register Periodic Tasks BackgroundAggregatorService.Add(() => new PeriodicCall(3)); //Start the background service BackgroundAggregatorService.StartBackgroundService(); } catch (Exception ex) { } }
public App() { BackgroundAggregatorService.Add(() => new PeriodicSevice(3)); //Start the background service BackgroundAggregatorService.StartBackgroundService(); InitializeComponent(); MainViewModel.GetInstance().About = new AboutViewModel(); MainViewModel.GetInstance().Search = new SearchViewModel(); DependencyService.Register <MockDataStore>(); //MainPage = new MainPage(); MainPage = new ShellPage(); }
protected override void OnStart() { BackgroundAggregatorService.Add(() => new AutomaticService(500)); BackgroundAggregatorService.StartBackgroundService(); //Start the background service }
public static async Task Connect(String chaveServicos, String codMotorista) { // _timer = new Timer(OnTickAsync, null, 2000, 1); if (_ws != null && _ws.State == WebSocketState.Open) { return; } //Verifico se servidor está disponível var client = new HttpClient { Timeout = TimeSpan.FromMilliseconds(8000), BaseAddress = new Uri("http://" + ViewModelBase.GetUrlBase() + "/motorapido/wes/") }; client.DefaultRequestHeaders.Add("Authentication", chaveServicos); try { var response = await client.GetAsync("motorista/ping"); Tuple <String, String> tupla = new Tuple <string, string>("Authentication", chaveServicos); List <Tuple <String, String> > lista = new List <Tuple <String, String> >(); lista.Add(tupla); tupla = new Tuple <string, string>("CodMotorista", codMotorista); lista.Add(tupla); IEnumerable <Tuple <String, String> > en = lista; var socketOptions = new PureWebSocketOptions() { DebugMode = true, SendDelay = 100, IgnoreCertErrors = true, MyReconnectStrategy = new ReconnectStrategy(2000, 4000, 20), Headers = en }; _ws = new PureWebSocket("ws://" + ViewModelBase.GetUrlBase() + "/motorapido/socket", socketOptions); _ws.OnStateChanged += Ws_OnStateChanged; _ws.OnMessage += Ws_OnMessage; _ws.OnClosed += Ws_OnClosed; _ws.OnSendFailed += Ws_OnSendFailed; var res = await _ws.ConnectAsync(); Console.ReadLine(); CrossSettings.Current.Remove("ServidorFora"); BackgroundAggregatorService.StopBackgroundService(); } catch (Exception e) { Crashes.TrackError(e); if (!CrossSettings.Current.Contains("ServidorFora")) { CrossSettings.Current.Set("ServidorFora", true); MessagingCenter.Send(new MensagemRespostaSocket() { msg = "Servidor indisponível!" }, "ErroPosicaoArea"); BackgroundAggregatorService.Add(() => new ChecagemServidorDisponivel()); BackgroundAggregatorService.StartBackgroundService(); } } }
protected override void OnStart() { BackgroundAggregatorService.Add(() => new CounterService(10)); BackgroundAggregatorService.StartBackgroundService(); }
protected override void OnStart() { // Handle when your app starts BackgroundAggregatorService.Add(() => new BackgroundRetryService()); }
protected override void OnStart() { BackgroundAggregatorService.StopBackgroundService(); BackgroundAggregatorService.Add(() => new BackgroundTaskJob(10)); //Task run every 10s BackgroundAggregatorService.StartBackgroundService(); }
private static void StartBackgroundService() { BackgroundAggregatorService.Add(() => new WriterService()); BackgroundAggregatorService.StartBackgroundService(); }