add non-block mode for queue