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
git clone https://github.com/owin/owin-sandbox.git | |
cd owin-sandbox | |
build start | |
(or simply) | |
git clone https://github.com/owin/owin-sandbox.git && owin-sandbox\build start | |
(then browse http://localhost:3001 and http://localhost:3002, etc) |
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
html | |
head | |
meta charset="utf-8" | |
title =ViewBag.Title | |
link href="~/Content/Site.css" rel="stylesheet" type="text/css" | |
script src="~/Scripts/jquery-1.5.1.min.js" type="text/javascript" | | |
script src="~/Scripts/modernizr-1.7.min.js" type="text/javascript" | | |
body div.page | |
header | |
#title h1 |My MVC 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; | |
using System.Collections.Generic; | |
using Gate.Owin; | |
using System.Text; | |
namespace Gate.Middleware | |
{ | |
public static class Chunked | |
{ | |
public static IAppBuilder UseChunked(this IAppBuilder builder) |
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
// current delegate | |
Action /*cancel*/ BodyDelegate( | |
Action<ArraySegment<byte>, Action, bool> next, | |
Action<Exception> error, | |
Action complete); | |
// node-like delegate | |
void BodyDelegate( | |
Action<ArraySegment<byte>, bool> write, | |
Action<Action, bool> flush, |
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.Net; | |
using System.Net.Sockets; | |
using System.Text; | |
using System.Web.Mvc; | |
namespace HeaderChecking.Controllers | |
{ | |
public class HomeController : Controller | |
{ | |
public ActionResult Index() |
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.IO; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace ObsBody | |
{ | |
internal class Program |
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 IBodyObservable = IObservable<Tuple< // body | |
ArraySegment<byte>, // data | |
Action, // delay | |
Action>>; //continuation | |
using BodyDelegate = Func< // body | |
Action< // next | |
ArraySegment<byte>, //data | |
Action, // continuation | |
bool>, // delayed |
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
public class Examples { | |
public void Foo() { | |
// these vars are all IObservable<string> | |
var src1 = Obs.Unit("one"); | |
var src2 = Obs.Create( | |
new[] { "one", "two", "three" }); | |
var src3 = Obs.Create<string>(write => { | |
write("one"); |
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.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using NUnit.Framework; | |
namespace FuncGist { | |
public static class ObservableExtensions { | |
public static Task Subscribe<T>(this IObservable<T> observable, Action<T> next) { |
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.Linq; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using NUnit.Framework; | |
namespace FuncGist { | |
// signature exposed by middleware and app |