private static void Initialize() { unityScheduler = System.Threading.Tasks.TaskScheduler.FromCurrentSynchronizationContext(); if (!Application.isEditor) { if (Debug.isDebugBuild) { Debug.Log($"{nameof(RNBridge)}: try initialize"); } try { if (Application.platform == RuntimePlatform.Android) { unityReact = new AndroidUnityReact(); } else { unityReact = new NativeUnityReact(); } } catch (System.Exception e) { Debug.LogError($"{nameof(RNBridge)}: exception during try initialize <{e.Message}>"); } } }
public AlloyBackgroundParser(ITextBuffer textBuffer, TaskScheduler taskScheduler, ITextDocumentFactoryService textDocumentFactoryService, IOutputWindowService outputWindowService) : base(textBuffer, taskScheduler, textDocumentFactoryService, outputWindowService) { Contract.Requires(textBuffer != null); Contract.Requires(taskScheduler != null); Contract.Requires(textDocumentFactoryService != null); Contract.Requires(outputWindowService != null); }
public AlloyBackgroundParser([NotNull] ITextBuffer textBuffer, [NotNull] TaskScheduler taskScheduler, [NotNull] ITextDocumentFactoryService textDocumentFactoryService, [NotNull] IOutputWindowService outputWindowService) : base(textBuffer, taskScheduler, textDocumentFactoryService, outputWindowService) { Debug.Assert(textBuffer != null); Debug.Assert(taskScheduler != null); Debug.Assert(textDocumentFactoryService != null); Debug.Assert(outputWindowService != null); }
public AlloyBackgroundParser(ITextBuffer textBuffer, TaskScheduler taskScheduler, ITextDocumentFactoryService textDocumentFactoryService, IOutputWindowService outputWindowService) : base(textBuffer, taskScheduler, textDocumentFactoryService, outputWindowService) { Contract.Requires(textBuffer != null); Contract.Requires(taskScheduler != null); Contract.Requires(textDocumentFactoryService != null); Contract.Requires(outputWindowService != null); }
public IOCompletionScheduler() { TPL = new IOCompletionPortTaskScheduler(50, 20); }
public ConcurrentExclusiveSchedulerPair(System.Threading.Tasks.TaskScheduler taskScheduler, int maxConcurrencyLevel, int maxItemsPerTask) { }
public ConcurrentExclusiveSchedulerPair(System.Threading.Tasks.TaskScheduler taskScheduler) { }
public static System.Threading.Tasks.Task <TNewResult> ContinueWith <TResult, TNewResult>(this System.Threading.Tasks.Task <TResult> task, System.Func <System.Threading.Tasks.Task <TResult>, object, TNewResult> continuationFunction, object state, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler);
public static System.Threading.Tasks.Task <TResult> ContinueWith <TResult>(this System.Threading.Tasks.Task task, System.Func <System.Threading.Tasks.Task, object, TResult> continuationFunction, object state, System.Threading.Tasks.TaskScheduler scheduler);
public static System.Threading.Tasks.Task ContinueWith <TResult>(this System.Threading.Tasks.Task <TResult> task, System.Action <System.Threading.Tasks.Task <TResult>, object> continuationAction, object state, System.Threading.Tasks.TaskScheduler scheduler);
public static System.Threading.Tasks.Task ContinueWith(this System.Threading.Tasks.Task task, System.Action <System.Threading.Tasks.Task, object> continuationAction, object state, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler);
public TestIOCompletionScheduler() { TPL = new CurrentThreadTaskScheduler(); }
static AppTrackingTransparency() { currentSynchronizationContext = System.Threading.Tasks.TaskScheduler.FromCurrentSynchronizationContext(); }
private void AcquirePushChannelAsync() { mainTaskScheduler = System.Threading.Tasks.TaskScheduler.FromCurrentSynchronizationContext(); //Im Hintergrund ausführen ist geschickter. var task = System.Threading.Tasks.Task.Factory.StartNew(() => { try { string pushChannelName = "DoItPushChannel"; this.notificationChannel = HttpNotificationChannel.Find(pushChannelName); if (this.data.NotificationsEnabled) { if (this.notificationChannel == null) { this.notificationChannel = new HttpNotificationChannel(pushChannelName); this.notificationChannel.Open(); this.notificationChannel.BindToShellToast(); this.notificationChannel.BindToShellTile(); } this.notificationChannel.ErrorOccurred += new EventHandler<NotificationChannelErrorEventArgs>(PushChannel_ErrorOccurred); this.notificationChannel.ShellToastNotificationReceived += notificationChannel_ShellToastNotificationReceived; } else if (this.notificationChannel != null) { this.notificationChannel.Close(); this.notificationChannel = null; } //Jetzt die Zahl auf dem Live Tile resetten. foreach (var tile in Microsoft.Phone.Shell.ShellTile.ActiveTiles) { #if WP8 tile.Update(new Microsoft.Phone.Shell.FlipTileData() { Count = 0, Title = Localization.Strings.ApplicationTitle, SmallBackgroundImage = new Uri("Background.png", UriKind.Relative), BackgroundImage = new Uri("Background.png", UriKind.Relative) }); #else tile.Update(new Microsoft.Phone.Shell.StandardTileData() { Count = 0, Title = Localization.Strings.ApplicationTitle, BackgroundImage = new Uri("Background.png", UriKind.Relative) }); #endif } } catch { //Sind ja nur Pushbenachrichtigungen. Kann man auch silent ignorieren. if (System.Diagnostics.Debugger.IsAttached) System.Diagnostics.Debugger.Break(); } }); task.ContinueWith<System.Threading.Tasks.Task>(async (System.Threading.Tasks.Task x) => { await ApplyUser(); }, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskContinuationOptions.None, mainTaskScheduler); }
private void AcquirePushChannelAsync() { mainTaskScheduler = System.Threading.Tasks.TaskScheduler.FromCurrentSynchronizationContext(); //Im Hintergrund ausführen ist geschickter. var task = System.Threading.Tasks.Task.Factory.StartNew(() => { try { string pushChannelName = "DoItPushChannel"; this.notificationChannel = HttpNotificationChannel.Find(pushChannelName); if (this.data.NotificationsEnabled) { if (this.notificationChannel == null) { this.notificationChannel = new HttpNotificationChannel(pushChannelName); this.notificationChannel.Open(); this.notificationChannel.BindToShellToast(); this.notificationChannel.BindToShellTile(); } this.notificationChannel.ErrorOccurred += new EventHandler <NotificationChannelErrorEventArgs>(PushChannel_ErrorOccurred); this.notificationChannel.ShellToastNotificationReceived += notificationChannel_ShellToastNotificationReceived; } else if (this.notificationChannel != null) { this.notificationChannel.Close(); this.notificationChannel = null; } //Jetzt die Zahl auf dem Live Tile resetten. foreach (var tile in Microsoft.Phone.Shell.ShellTile.ActiveTiles) { #if WP8 tile.Update(new Microsoft.Phone.Shell.FlipTileData() { Count = 0, Title = Localization.Strings.ApplicationTitle, SmallBackgroundImage = new Uri("Background.png", UriKind.Relative), BackgroundImage = new Uri("Background.png", UriKind.Relative) }); #else tile.Update(new Microsoft.Phone.Shell.StandardTileData() { Count = 0, Title = Localization.Strings.ApplicationTitle, BackgroundImage = new Uri("Background.png", UriKind.Relative) }); #endif } } catch { //Sind ja nur Pushbenachrichtigungen. Kann man auch silent ignorieren. if (System.Diagnostics.Debugger.IsAttached) { System.Diagnostics.Debugger.Break(); } } }); task.ContinueWith <System.Threading.Tasks.Task>(async(System.Threading.Tasks.Task x) => { await ApplyUser(); }, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskContinuationOptions.None, mainTaskScheduler); }
/// <summary> /// TaskSchedulerからTaskを呼び出し。 /// </summary> /// <param name="scheduler"></param> /// <param name="action"></param> /// <returns></returns> public static System.Threading.Tasks.Task TaskStart(this System.Threading.Tasks.TaskScheduler scheduler, Action action) { return(System.Threading.Tasks.Task.Factory.StartNew(action, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, scheduler)); }