Comments (8)
Have you tried RestClient.setTimeoutLength()
?
from jraw.
This method sets only connection timeout length, not read timeout which I was talking about.
from jraw.
I think it would be a good idea to remove/deprecate setTimeoutLength()
and provide a getOkHttpClient()
method, which would allow you to configure the client directly. How do you feel about that?
from jraw.
It is fine by me. The question is how tightly do you want to couple your project with okhttp client.
from jraw.
In the next release you should be able to adjust the read timeout using reddit.getHttpAdapter().setReadTimeout(int)
.
from jraw.
What happened to getOkHttpClient()
? With the new interceptors features, it would be great to be able to take advantage of that. A good use case would be with Facebook's new Stetho
library, which plugs into it with its own interceptor: https://github.com/facebook/stetho
A good middleground would be to maybe expose this as part of HttpAdapter, but not sure if you want that to have anything specific to OkHttp.
from jraw.
getOkHttpClient()
was removed in favor of getHttpAdapter()
as it decouples JRAW from any specific HTTP library. The default implementation of HttpAdapter
(OkHttpAdapter
) still uses OkHttp, but the the interface is written in such a way that HttpAdapters could be made for HttpComponents or some other library without an API change.
If you wanted to bring a method like getOkHttpClient()
back, I would suggest introducing generics to HttpAdapter:
public interface HttpAdapter<T> {
// <other methods here>
public T getNativeClient();
}
So then HttpAdapter could be declared like this:
public class OkHttpAdapter extends HttpAdapter<OkHttpClient>
from jraw.
That seems reasonable to me. Would you be open to a pull request for that?
from jraw.
Related Issues (20)
- oauth version 1.0 is forbidden in reddit HOT 1
- How to use after and before HOT 1
- Possible token refresh race condition with streams HOT 1
- GET Replies to comments
- Adding Support for Community Awards HOT 1
- 404 errors being returned
- Always getting 403 Forbidden when using DefaultPaginator HOT 1
- Add a resubmit argument to SubmitReference.submit
- NullPointerException caused by outdated OkHttp HOT 1
- Extend existing model with new properties
- NullPointer EmbeddedMedia even on v1.1.0 HOT 3
- Problems setting up gradle dependencies HOT 2
- Intermittent JSON parsing exceptions HOT 2
- Support for Image Collection posts
- Upcoming OAuth2 changes
- Submission get upvote and downvote instead of score HOT 1
- Deprecation of jcenter() HOT 1
- How to get the followers count?
- Is there a way to access "Insights" on my own posts?
- 'java.lang.String okhttp3.internal.Internal.cookieToString(okhttp3.Cookie, boolean)'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jraw.