Skip to content

Instantly share code, notes, and snippets.

Avatar

x0a1b

  • DoorDash
  • San Francisco, CA
View GitHub Profile
View ClusteredSlidingWindowRateLimiter.kt
import io.lettuce.core.ScriptOutputType
import io.lettuce.core.cluster.api.StatefulRedisClusterConnection
import kotlinx.coroutines.future.asDeferred
import java.time.Duration
import java.util.UUID
class ClusteredSlidingWindowRateLimiter(
redisClient: StatefulRedisClusterConnection<String, String>
) : RateLimiter {
companion object {
View LettuceConfigFactory.java
import io.lettuce.core.TimeoutOptions;
import io.lettuce.core.cluster.ClusterClientOptions;
import io.lettuce.core.cluster.ClusterTopologyRefreshOptions;
import java.time.Duration;
public class LettuceConfigFactory {
public static final int DEFAULT_TIMEOUT_MILLIS = 1000;
public static final int DEFAULT_REFRESH_TRIGGERS_RECONNECT_ATTEMPTS = 3;
@x0a1b
x0a1b / example1.kt
Last active Jan 21, 2020
Greeter service snippets
View example1.kt
val person = Person.newBuilder()
.setName("Hello Kitty")
.setAddress(
Address.newBuilder()
.setNumber(123)
.setStreet("Hello Kitty Street")
.setPostcode("N304SD")
.build())
.build()
@x0a1b
x0a1b / LICENSE
Last active Nov 4, 2019
Writing delightful middlewares in Go
View LICENSE
Copyright (c) 2019 DoorDash
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all