Created
June 10, 2014 06:24
-
-
Save NiteshKant/6ed315fd717fbd9f5f01 to your computer and use it in GitHub Desktop.
Ribbon api design
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
package com.netflix.client.netty; | |
import io.netty.buffer.ByteBuf; | |
import io.reactivex.netty.protocol.http.client.HttpClient; | |
/** | |
* @author Nitesh Kant | |
*/ | |
public final class Ribbon { | |
private Ribbon() { | |
} | |
public static <I, O> RibbonHttpClient<I, O> newHttpClient(HttpClient<I, O> transportClient) { | |
return null; | |
} | |
public static <I, O, T> T newHttpClient(Class<T> contract, HttpClient<I, O> transportClient) { | |
return null; | |
} | |
public static void main(String[] args) { | |
HttpClient<ByteBuf, ByteBuf> transportClient = RibbonTransport.newHttpClient("myclient"); | |
Ribbon.newHttpClient(transportClient).newRequestTemplate() | |
.withUri("/{id}").supplier().withValue("id", 1).toRequest().execute(); | |
} | |
} |
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
package com.netflix.client.netty; | |
import com.netflix.client.config.IClientConfig; | |
import com.netflix.loadbalancer.ILoadBalancer; | |
import io.netty.buffer.ByteBuf; | |
import io.reactivex.netty.client.RxClient; | |
import io.reactivex.netty.protocol.http.client.HttpClient; | |
import io.reactivex.netty.protocol.udp.client.UdpClient; | |
/** | |
* @author Nitesh Kant | |
*/ | |
public final class RibbonTransport { | |
private RibbonTransport() { | |
} | |
public static RxClient<ByteBuf, ByteBuf> newTcpClient(ILoadBalancer loadBalancer, IClientConfig config) { | |
return null; | |
} | |
public static RxClient<ByteBuf, ByteBuf> newTcpClient(String name) { | |
return null; | |
} | |
public static UdpClient<ByteBuf, ByteBuf> newUdpClient(ILoadBalancer loadBalancer, IClientConfig config) { | |
return null; | |
} | |
public static UdpClient<ByteBuf, ByteBuf> newUdpClient(String name) { | |
return null; | |
} | |
public static HttpClient<ByteBuf, ByteBuf> newHttpClient(ILoadBalancer loadBalancer, IClientConfig config) { | |
return null; | |
} | |
public static HttpClient<ByteBuf, ByteBuf> newHttpClient(String name) { | |
return null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment