Dave.
On Dec 14, 6:14 pm, bradf...@golang.org wrote:
> Reviewers: golang-dev_googlegroups.com,
>
> Message:
> Hello golan...@googlegroups.com (cc: golan...@googlegroups.com),
>
> I'd like you to review this change tohttps://go.googlecode.com/hg
>
> Description:
> net: RFC: API proposal for DialPlan
>
> This is an API proposal that Russ and I sketched out
> awhile back and recently dusted off.
>
> Let's discuss the API before any implementation.
>
> Issue 240
>
> Please review this athttp://codereview.appspot.com/5486078/
> + // Seehttp://tools.ietf.org/html/draft-ietf-v6ops-happy-eyeballs-06
> + SoftTimeout time.Duration
> +}
> +
> +func (p *DialPlan) Dial() (Conn, error) {
> + panic("TODO")
> +}
> +
> +func NewDialPlan(net, addr string) *DialPlan {
> + panic("TODO")
> +}
Does NewDialPlan generate a default DialPlan for the given net and
addr? For example, if addr is "www.google.com", I'm guessing
NewDialPlan will resolve that DNS name into several IP addresses, each
one of which becomes a DialAttempt in the DialPlan. The SoftTimeout
and Timeout for each are set to some default values. The user can
modify these before invoking Dial to execute the plan. Fancier dial
plans might implement some load balancing policy, though it's unclear
which parameter of NewDialPlan encodes this policy. (Presumably this
same pattern could be applied to other replicated operations, e.g.,
connecting/reading/writing to the nearest available database replica.)
"DialAttempt" sounds like a completed attempt, not a planned attempt.
Perhaps "DialTarget" would be a better name.
Should NewDialPlan take a timeout parameter and ensure that each
DialAttempt.Timeout matches this? Alternatively, DialPlan.SetTimeout
could set the timeout for all planned DialAttempts.
Is "SoftTimeout" a well-known term? I've called this
"FailoverTimeout" in similar interfaces for talking to replicated
storage backends; that seems to convey more meaning.
If I have multiple targets for an RPC, I want to keep dialing until
the RPC completes. This API only gets to the starting line.
I think that's debatable. You want to find a server that
will take the RPC. Whether you want to have multiple
servers working on your RPC racing to be the one who
gets done first is a separate issue. In any event, that's
not what this CL is or needs to be about. This is just
about trying to connect.
Russ