Skip to content

Commit

Permalink
Issue ReactiveX#12 aligning with master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
storozhukBM committed Dec 2, 2016
1 parent 91f21a2 commit 7032382
Show file tree
Hide file tree
Showing 19 changed files with 62 additions and 52 deletions.
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ dependencies {
testCompile "org.powermock:powermock:1.6.6"
testCompile "org.powermock:powermock-api-mockito:1.6.6"
testCompile "org.powermock:powermock-module-junit4:1.6.6"
testCompile "io.projectreactor:reactor-core:2.5.0.M2"
testCompile "com.jayway.awaitility:awaitility:1.7.0"

jmh "ch.qos.logback:logback-classic:0.9.26"
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Jan 04 11:12:51 CET 2016
#Fri Dec 02 19:26:12 EET 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-bin.zip
12 changes: 8 additions & 4 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ case "`uname`" in
;;
esac

# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
Expand All @@ -56,9 +61,9 @@ while [ -h "$PRG" ] ; do
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
cd "$SAVED" >&-

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

Expand Down Expand Up @@ -109,7 +114,6 @@ fi
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
Expand Down Expand Up @@ -157,4 +161,4 @@ function splitJvmOpts() {
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,7 @@
*/
package io.github.robwin.circuitbreaker;

import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Measurement;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.annotations.Threads;
import org.openjdk.jmh.annotations.Warmup;
import org.openjdk.jmh.annotations.*;

import java.time.Duration;
import java.util.concurrent.TimeUnit;
Expand All @@ -38,11 +29,11 @@
@BenchmarkMode(Mode.Throughput)
public class CircuitBreakerBenchmark {

private CircuitBreaker circuitBreaker;
private Supplier<String> supplier;
private static final int ITERATION_COUNT = 10;
private static final int WARMUP_COUNT = 10;
private static final int THREAD_COUNT = 10;
private CircuitBreaker circuitBreaker;
private Supplier<String> supplier;

@Setup
public void setUp() {
Expand All @@ -69,4 +60,4 @@ public void setUp() {
public String invokeSupplier() {
return supplier.get();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ public void setBits(){
ringBitSet.setNextBit(true);
ringBitSet.setNextBit(false);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
package javaslang.circuitbreaker;
/*
*
* Copyright 2015 Robert Winkler and Bohdan Storozhuk
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*/
package io.github.robwin.ratelimiter;

import javaslang.ratelimiter.RateLimiter;
import javaslang.ratelimiter.RateLimiterConfig;
import javaslang.ratelimiter.internal.AtomicRateLimiter;
import javaslang.ratelimiter.internal.SemaphoreBasedRateLimiter;
import io.github.robwin.ratelimiter.internal.AtomicRateLimiter;
import io.github.robwin.ratelimiter.internal.SemaphoreBasedRateLimiter;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Fork;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package javaslang.ratelimiter;
package io.github.robwin.ratelimiter;

import javaslang.control.Try;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package javaslang.ratelimiter;
package io.github.robwin.ratelimiter;

import static java.util.Objects.requireNonNull;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package javaslang.ratelimiter;
package io.github.robwin.ratelimiter;

import javaslang.ratelimiter.internal.InMemoryRateLimiterRegistry;
import io.github.robwin.ratelimiter.internal.InMemoryRateLimiterRegistry;

import java.util.function.Supplier;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package javaslang.ratelimiter;
package io.github.robwin.ratelimiter;

/**
* Exception that indicates that current thread was not able to acquire permission
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package javaslang.ratelimiter.internal;
package io.github.robwin.ratelimiter.internal;

import static java.lang.Long.min;
import static java.lang.System.nanoTime;
import static java.lang.Thread.currentThread;
import static java.util.concurrent.locks.LockSupport.parkNanos;

import javaslang.ratelimiter.RateLimiter;
import javaslang.ratelimiter.RateLimiterConfig;
import io.github.robwin.ratelimiter.RateLimiter;
import io.github.robwin.ratelimiter.RateLimiterConfig;

import java.time.Duration;
import java.util.concurrent.atomic.AtomicInteger;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package javaslang.ratelimiter.internal;
package io.github.robwin.ratelimiter.internal;

import static java.util.Objects.requireNonNull;

import javaslang.ratelimiter.RateLimiter;
import javaslang.ratelimiter.RateLimiterConfig;
import javaslang.ratelimiter.RateLimiterRegistry;
import io.github.robwin.ratelimiter.RateLimiter;
import io.github.robwin.ratelimiter.RateLimiterConfig;
import io.github.robwin.ratelimiter.RateLimiterRegistry;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package javaslang.ratelimiter.internal;
package io.github.robwin.ratelimiter.internal;

import static java.util.Objects.requireNonNull;
import static java.util.concurrent.Executors.newSingleThreadScheduledExecutor;

import javaslang.control.Option;
import javaslang.ratelimiter.RateLimiter;
import javaslang.ratelimiter.RateLimiterConfig;
import io.github.robwin.ratelimiter.RateLimiter;
import io.github.robwin.ratelimiter.RateLimiterConfig;

import java.time.Duration;
import java.util.concurrent.ScheduledExecutorService;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package javaslang.ratelimiter;
package io.github.robwin.ratelimiter;

import static org.assertj.core.api.BDDAssertions.then;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package javaslang.ratelimiter;
package io.github.robwin.ratelimiter;

import static org.assertj.core.api.BDDAssertions.then;
import static org.mockito.Matchers.any;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package javaslang.ratelimiter.internal;
package io.github.robwin.ratelimiter.internal;

import static com.jayway.awaitility.Awaitility.await;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
Expand All @@ -7,7 +7,7 @@
import static org.hamcrest.CoreMatchers.equalTo;

import com.jayway.awaitility.core.ConditionFactory;
import javaslang.ratelimiter.RateLimiterConfig;
import io.github.robwin.ratelimiter.RateLimiterConfig;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package javaslang.ratelimiter.internal;
package io.github.robwin.ratelimiter.internal;

import static org.assertj.core.api.BDDAssertions.then;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import javaslang.ratelimiter.RateLimiter;
import javaslang.ratelimiter.RateLimiterConfig;
import javaslang.ratelimiter.RateLimiterRegistry;
import io.github.robwin.ratelimiter.RateLimiter;
import io.github.robwin.ratelimiter.RateLimiterConfig;
import io.github.robwin.ratelimiter.RateLimiterRegistry;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package javaslang.ratelimiter.internal;
package io.github.robwin.ratelimiter.internal;

import static com.jayway.awaitility.Awaitility.await;
import static com.jayway.awaitility.Duration.FIVE_HUNDRED_MILLISECONDS;
Expand All @@ -16,8 +16,8 @@
import static org.mockito.Mockito.verify;

import com.jayway.awaitility.core.ConditionFactory;
import javaslang.ratelimiter.RateLimiter;
import javaslang.ratelimiter.RateLimiterConfig;
import io.github.robwin.ratelimiter.RateLimiter;
import io.github.robwin.ratelimiter.RateLimiterConfig;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
Expand Down

0 comments on commit 7032382

Please sign in to comment.