浏览代码

Updated SimpleRetryPolicy documentation to include usage examples.

Phillip Couto 11 年之前
父节点
当前提交
7ebf2ec49a
共有 1 个文件被更改,包括 14 次插入2 次删除
  1. 14 2
      policies.go

+ 14 - 2
policies.go

@@ -14,12 +14,24 @@ type RetryableQuery interface {
 // again after a retryable error has been received. The interface allows gocql
 // users to implement their own logic to determine if a query can be attempted
 // again.
-// See SimpleRetryPolicy as an example of implementing the RetryPolicy interface.
+//
+// See SimpleRetryPolicy as an example of implementing and using a RetryPolicy
+// interface.
 type RetryPolicy interface {
 	Attempt(RetryableQuery) bool
 }
 
-// SimpleRetryPolicy has simple logic for attempting a query a fixed number of times.
+/*
+SimpleRetryPolicy has simple logic for attempting a query a fixed number of times.
+
+See below for examples of usage:
+
+	//Assign to the cluster
+	cluster.RetryPolicy = &gocql.SimpleRetryPolicy{NumRetries: 3}
+
+	//Assign to a query
+ 	query.RetryPolicy(&gocql.SimpleRetryPolicy{NumRetries: 1})
+*/
 type SimpleRetryPolicy struct {
 	NumRetries int //Number of times to retry a query
 }