yangweigbh / VolleyX

Volley + RxJava, use Volley the Rx way
Apache License 2.0
66 stars 5 forks source link

VolleyX do not use HttpStack #6

Open denis-stepushchik-mobexs opened 7 years ago

denis-stepushchik-mobexs commented 7 years ago

It will be good to change init method on something like this

public static void init(Context context, HttpStack httpStack) {
        if (context == null) throw new NullPointerException("context can not be null");
        sContext = context;

        DEFAULT_REQUESTQUEUE = Volley.newRequestQueue(sContext, httpStack);
        sRequestQueue = DEFAULT_REQUESTQUEUE;

        sInited = true;
    }
denis-stepushchik-mobexs commented 7 years ago

And add init method without httpStack

public static void init(Context context) {
        init(context, null);
    }
yangweigbh commented 7 years ago

actually, if you want to use request queue with your custom httpstack, you can create a request queue and call setRequestQueue to replace the default request queue. i think the init method should be as simple as possible, what do you think