Simulation of the Prisoners riddle as seen on Veritasium YouTube
OK, you can pretty much ignore what I wrote below this update, because it doesn't really apply anymore.
I wrote this over a year ago, and at the time I had spent a couple of weeks trying to get Kafka 0.8 working with .NET and then Node.js with much frustration and very little success. I was rather angry. It keeps getting linked, though, and just popped up on Hacker News, so here's sort of an update, although I haven't used Kafka at all this year so I don't really have any new information.
In the end, we managed to get things working with a Node.js client, although we continued to have problems, both with our code and with managing a Kafka/Zookeeper cluster generally. What made it worse was that I did not then, and do not now, believe that Kafka was the correct solution for that particular problem at that particular company. What they were trying to achieve could have been done more simply with any number of other messaging systems, with a subscriber reading messages off and writing
using System.Security.Claims; | |
using Microsoft.AspNetCore.Http; | |
namespace TypedClaimsPrincipal; | |
public interface IClaimsPrincipalProperties<out T> | |
where T : IClaimsPrincipalProperties<T> | |
{ | |
static abstract T Create(ClaimsPrincipal claimsPrincipal); | |
} |
public class ChannelsQueue : IJobQueue<Action> | |
{ | |
private ChannelWriter<Action> _writer; | |
public ChannelsQueue() | |
{ | |
var channel = Channel.CreateUnbounded<Action>(); | |
var reader = channel.Reader; | |
_writer = channel.Writer; | |
public static async Task Main(string[] args) | |
{ | |
var host = CreateHostBuilder(args).Build(); | |
var task = host.RunAsync(); | |
var serverAddresses = host.Services.GetRequiredService<IServer>() | |
.Features | |
.Get<IServerAddressesFeature>(); |
internal class ObsoleteLoggingInterceptor : Interceptor | |
{ | |
private readonly ILogger<ObsoleteLoggingInterceptor> _logger; | |
public ObsoleteLoggingInterceptor(ILogger<ObsoleteLoggingInterceptor> logger) | |
{ | |
_logger = logger; | |
} | |
public override AsyncUnaryCall<TResponse> AsyncUnaryCall<TRequest, TResponse>(TRequest request, |
I hereby claim:
- I am markrendle on github.
- I am rendle (https://keybase.io/rendle) on keybase.
- I have a public key ASDQ0O3lbZRJvt1ZVJW5eOADbKKANZ3TNvT8kAoZq7Ox7go
To claim this, I am signing this object:
using System.CodeDom.Compiler; | |
using System.IO; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace IndentFail | |
{ | |
class Program | |
{ | |
static async Task Main(string[] args) |
var gulp = require('gulp'), | |
hint = require('gulp-jshint'), | |
uglify = require('gulp-uglify'), | |
rename = require('gulp-rename'); | |
gulp.task('lint', function() { | |
return gulp.src(['Scripts/**/*.js']) | |
.pipe(hint()); | |
}); |
using Greet; | |
using Grpc.Core; | |
namespace ClientApp | |
{ | |
class Program | |
{ | |
static async Task Main(string[] args) | |
{ | |
var channel = new Channel("localhost:50051", |