This file contains 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
var loadedSignal = new WinJS._Signal(); | |
document.addEventListener("load", function () { loadedSignal.complete(); }); | |
function loadDataAsync() { | |
return WinJS.xhr("uri"); | |
} | |
//setup code | |
loadedSignal.promise | |
.then(loadDataAsync) |
This file contains 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
// EXAMPLE 1 | |
var promise = new WinJS.Promise(function (completeCallback, errorCallback) { | |
// do some async operation | |
// if completed properly, call completeCallback() | |
// otherwise call errorCallback(error) | |
}); | |
//EXAMPLE 2 | |
// extenally managed promise |
This file contains 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
private static readonly BufferBlock<string> Buffer = new BufferBlock<string>(); | |
static void Main(string[] args) | |
{ | |
Enumerable.Range(0, 100).ToList().ForEach(i => Buffer.SendAsync("Mesage #" + i)); | |
var consumer = new ActionBlock<string>(s => Process(s), new ExecutionDataflowBlockOptions { MaxDegreeOfParallelism = 5 }); | |
Buffer.LinkTo(consumer); | |
Buffer.Completion.ContinueWith(t => consumer.Complete()); |
This file contains 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
WinJS.Namespace.define("Application", { | |
Derived: WinJS.Namespace._lazy(function() { | |
return WinJS.Class.derive(Application.Parent, function() { | |
}); | |
}) | |
}); | |
WinJS.Namespace.define("Application", { |
This file contains 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.Runtime.Serialization; | |
namespace WcfWorkerRole.Contract | |
{ | |
[DataContract] | |
public class ProductData | |
{ | |
[DataMember] | |
public string SKU { get; set; } |
This file contains 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
<?xml version="1.0" encoding="utf-8" ?> | |
<configuration> | |
<system.diagnostics> | |
<trace> | |
<listeners> | |
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" | |
name="AzureDiagnostics"> | |
<filter type="" /> | |
</add> | |
</listeners> |
This file contains 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; | |
using System.Collections.Generic; | |
using System.Configuration; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Net; | |
using System.ServiceModel; | |
using System.ServiceModel.Web; | |
using System.Threading; | |
using Microsoft.WindowsAzure; |
OlderNewer