(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
var pipeworks = require('pipeworks'); | |
var wip = 0; | |
var limit = 2; | |
var total = 0; | |
var check = function(context, next) { | |
if (wip === limit) { | |
console.log('I\'ll eat', context.food, 'later...'); | |
setTimeout(check.bind(this, context, next), 2000); |
var domain = require("domain"); | |
var defaultHandler = require("express").errorHandler(); | |
module.exports = function errorHandler(err, req, res, next) { | |
if (domain.active) { | |
domain.active.emit("error", err); | |
} | |
else { | |
return defaultHandler(err, req, res, next); | |
} |
public class SlightlyBetterButStillNotGreatDispatcher | |
{ | |
private readonly IEventStoreConnection _connection; | |
private readonly IPersistGetEventStorePosition _positionCheckpoint; | |
private readonly IPublisher _next; | |
private readonly Action<EventStoreCatchUpSubscription> _onLiveProcessingStarted; | |
private EventStoreAllCatchUpSubscription _subscription; | |
public SlightlyBetterButStillNotGreatDispatcher(IEventStoreConnection connection, IPersistGetEventStorePosition positionCheckpoint, |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
public class MessageIdentity | |
{ | |
public Guid NameSpace; | |
private readonly byte[] _namespaceBytes; | |
public MessageIdentity(Guid guidNameSpace) | |
{ | |
NameSpace = guidNameSpace; | |
_namespaceBytes = guidNameSpace.ToByteArray(); | |
SwapByteOrder(_namespaceBytes); |
In all the discussions about ES6 one thing is bugging me. I'm picking one random comment here from this io.js issue but it's something that comes up over and over again:
There's sentiment from one group that Node should have full support for Promises. While at the same time another group wants generator syntax support (e.g.
var f = yield fs.stat(...)
).
People keep putting generators, callbacks, co, thunks, control flow libraries, and promises into one bucket. If you read that list and you think "well, they are all kind of doing the same thing", then this is to you.
var order = [...]int{3, 2, 1, 0, 5, 4, 7, 6, 8, 9, 10, 11, 12, 13, 14, 15} | |
func wtfToUUID(netEncoded []byte) uuid.UUID { | |
uuidBytes := make([]byte, 16) | |
for i := 0; i < len(order); i++ { | |
uuidBytes[i] = netEncoded[order[i]] | |
} | |
return uuidBytes | |
} |
using System; | |
using System.CodeDom; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Net; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using EventStore.ClientAPI; | |
using EventStore.ClientAPI.Embedded; |