This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="import" href="../topeka-elements/category-icons.html"> | |
<link rel="import" href="../core-icon/core-icon.html"> | |
<link rel="import" href="../chart-js/chart-js.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Observable.Timer(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10)) | |
.ObserveOn(Scheduler.ThreadPool.AsSafe()) | |
.Subscribe(_=> ThreadMethod()); | |
public static class SafeSchedulerExtensions | |
{ | |
public static IScheduler AsSafe(this IScheduler scheduler) | |
{ | |
return new SafeScheduler(scheduler); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Linq; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
namespace System.Web.Http | |
{ | |
/// <summary> | |
/// Extends the HttpRequestMessage collection |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IEnumerable<Task<Image>> tasks = s_Domains.Select(GetFavicon); | |
// The IEnumerable from Select is lazy, so evaluate it to start the tasks | |
tasks = tasks.ToList(); | |
Task<Image[]> allTask = Task.WhenAll(tasks); | |
Then, all we have left to do is await the allTask, and use its results: | |
Image[] images = await allTask; | |
foreach (Image eachImage in images) | |
{ | |
AddAFavicon(eachImage); |