This file contains hidden or 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
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 { |
This file contains hidden or 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
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; |
This file contains hidden or 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
val person = Person.newBuilder() | |
.setName("Hello Kitty") | |
.setAddress( | |
Address.newBuilder() | |
.setNumber(123) | |
.setStreet("Hello Kitty Street") | |
.setPostcode("N304SD") | |
.build()) | |
.build() |
This file contains hidden or 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
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 |