<s> from hazelcast . protocol . codec import transactional_queue_offer_codec , transactional_queue_peek_codec , transactional_queue_poll_codec , transactional_queue_size_codec , transactional_queue_take_codec <EOL> from hazelcast . proxy . base import TransactionalProxy <EOL> from hazelcast . util import check_not_none , to_millis <EOL> class TransactionalQueue ( TransactionalProxy ) : <EOL> def offer ( self , item , timeout = <NUM_LIT:0> ) : <EOL> check_not_none ( item , "<STR_LIT>" ) <EOL> return self . _encode_invoke ( transactional_queue_offer_codec , item = self . _to_data ( item ) , <EOL> timeout = to_millis ( timeout ) ) <EOL> def take ( self ) : <EOL> return self . _encode_invoke ( transactional_queue_take_codec ) <EOL> def poll ( self , timeout = <NUM_LIT:0> ) : <EOL> return self . _encode_invoke ( transactional_queue_poll_codec , timeout = to_millis ( timeout ) ) <EOL> def peek ( self , timeout = <NUM_LIT:0> ) : <EOL> return self . _encode_invoke ( transactional_queue_peek_codec , timeout = to_millis ( timeout ) ) <EOL> def size ( self ) : <EOL> return self . _encode_invoke ( transactional_queue_size_codec ) </s>
