public void ScheduleDeferredCleanupTask(Action <CancellationToken> a) { _ = _threadingContext.RunWithShutdownBlockAsync(async cancellationToken => { await _threadingContext.JoinableTaskFactory.StartOnIdle( () => a(cancellationToken), VsTaskRunContext.UIThreadNormalPriority); }); }
public AbstractSnippetInfoService( IThreadingContext threadingContext, Shell.IAsyncServiceProvider serviceProvider, Guid languageGuidForSnippets, IAsynchronousOperationListenerProvider listenerProvider) : base(threadingContext) { _waiter = listenerProvider.GetListener(FeatureAttribute.Snippets); _languageGuidForSnippets = languageGuidForSnippets; _threadingContext = threadingContext; _threadingContext.RunWithShutdownBlockAsync((_) => InitializeAndPopulateSnippetsCacheAsync(serviceProvider)); }