-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add maven modules with okhttp implementation
- Loading branch information
1 parent
3db3c6a
commit dc6b459
Showing
206 changed files
with
802 additions
and
149 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>dev.failsafe</groupId> | ||
<artifactId>failsafe-parent</artifactId> | ||
<version>3.2.2-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>failsafe</artifactId> | ||
<name>Failsafe</name> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<version>3.1.1</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>test-jar</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright 2022 the original author or authors. | ||
* | ||
* 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 dev.failsafe; | ||
|
||
import dev.failsafe.function.CheckedRunnable; | ||
|
||
/** | ||
* A call that can perform Failsafe executions and can be cancelled. Cancellations are propagated to any {@link | ||
* ExecutionContext#onCancel(CheckedRunnable) cancelCallback} that is registered. Useful for integrating with libraries | ||
* that support cancellation. | ||
* <p> | ||
* To perform cancellable async executions, use the {@link FailsafeExecutor} async methods. | ||
* </p> | ||
* | ||
* @param <R> result type | ||
* @author Jonathan Halterman | ||
*/ | ||
public interface Call<R> { | ||
/** | ||
* Executes the call until a successful result is returned or the configured policies are exceeded. | ||
* | ||
* @throws FailsafeException if the execution fails with a checked Exception. {@link FailsafeException#getCause()} can | ||
* be used to learn the underlying checked exception. | ||
*/ | ||
R execute(); | ||
|
||
/** | ||
* Cancels a synchronous execution by calling the most recent {@link ExecutionContext#onCancel(CheckedRunnable) | ||
* cancelCallback} that was registered during the execution and marking the execution as cancelled. The execution is | ||
* still allowed to complete and return a result. In addition to using a {@link ExecutionContext#onCancel(CheckedRunnable) | ||
* cancelCallback}, executions can cooperate with cancellation by checking {@link ExecutionContext#isCancelled()}. | ||
*/ | ||
void cancel(); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright 2022 the original author or authors. | ||
* | ||
* 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 dev.failsafe; | ||
|
||
/** | ||
* A call implementation that delegates to an execution. | ||
* | ||
* @param <R> result type | ||
* @author Jonathan Halterman | ||
*/ | ||
class CallImpl<R> implements Call<R> { | ||
private volatile SyncExecutionImpl<R> execution; | ||
|
||
void setExecution(SyncExecutionImpl<R> execution) { | ||
this.execution = execution; | ||
} | ||
|
||
@Override | ||
public R execute() { | ||
return execution.executeSync(); | ||
} | ||
|
||
@Override | ||
public void cancel() { | ||
execution.cancel(); | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains 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
This file contains 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
File renamed without changes.
File renamed without changes.
Oops, something went wrong.