Closed xuehui1991 closed 2 years ago
Hey,
Yes, the writer will block when the conditions of the rate limiter is not met. However, in order to allow users to control how much run-ahead is suitable this blocking only occur when calling flush
and end_episode
. It is therefore good practice to always call flush
right after create_item
to ensure the right level of run ahead.
For example:
with client.trajectory_writer(...) as writer:
for step in episode:
writer.append(step)
...
writer.create_item(....)
# Blocks until all but at most MAX_IN_FLIGHT_ITEMS items are inserted into the table.
writer.flush(block_until_num_items=MAX_IN_FLIGHT_ITEMS)
# Blocks until all pending items are inserted into the table.
writer.end_episode()
@acassirer Thank you very much.
Hello reverb team,
When using the client's writer to append data to the buffer, will the client be blocked if the condition of
SampleToInsertRatio
is not met? Or the client will run the next line code without blocking?Thank you all.
Guess @acassirer could give me some answer?