A brief introduction from the python-chinese mailing list

xiaoxiao2021-03-06  14

get

There are two modes of blocking and non-blocking implementation, and no data is not returned. Non-blocking mode has a timeout, if there is no data back to the timeout, the get () method will trigger an exception, and you can process it in the program.

Get ([block [, timeout])

REMOVE AND RETURN An Item from the Queue. If Optional Args Block IS

True and Timeout Is None (THE Default), Block if Necessary UnTil A

Item Is Available. if Timeout Is A Positive Number, IT Blocks At MOST

Timeout Seconds And Raises The EMPTY EXCETION IF NO ITEM WAS

Available Within Time. Otherwise (Block is false), Return An Item

IF One is immediately available, else raise the empty exception

(TIMEOUT IGNORED IN THAT CASE).

ON WED, 9 Mar 2005 14:44:48 0800, Carambo <

QUTR@tjub.com.cn> Wrote:

> Hello everyone:

>

I now define a queue module, use the PUT () method to add data, then use get () to take the data, if the queue is empty, do you need my own to judge an abnormal?

转载请注明原文地址:https://www.9cbs.com/read-48925.html

New Post(0)