接口Scheduler中方法poll,是否是拼写错误?
源码
public interface Scheduler {
/**
* add a url to fetch
*
* @param request
* @param task
*/
public void push(Request request, Task task);
/**
* get an url to crawl
*
* @param task the task of spider
* @return the url to crawl
*/
public Request poll(Task task);
}
中,方法poll是拼写错误吗?是不是应该写作pull?正好对应的是push?
的确是拼写错误^-^
On Jun 19, 2014, at 06:48 PM, stonesun [email protected] wrote:
源码 public interface Scheduler {
/**
-
add a url to fetch *
-
@param request
-
@param task */ public void push(Request request, Task task);
/**
-
get an url to crawl *
-
@param task the task of spider
-
@return the url to crawl */ public Request poll(Task task);
} 中,方法poll是拼写错误吗?是不是应该写作pull?正好对应的是push? — Reply to this email directly or view it on GitHub.
这里写作poll更合适 参考Queue interface
根据@sebastian1118提供的线索,这里应该是poll没有错。
证据是Java中的 Interface java.util.Queue<E>,参见http://docs.oracle.com/javase/7/docs/api/java/util/Queue.html
长知识了。才疏学浅,见笑见笑。