@@ -71,43 +71,18 @@ class AsyncMultiRangeDownloader:
7171 client, bucket_name="chandrasiri-rs", object_name="test_open9"
7272 )
7373 my_buff1 = open('my_fav_file.txt', 'wb')
74- my_buff1 = open('my_fav_file.txt', 'wb')
7574 my_buff2 = BytesIO()
7675 my_buff3 = BytesIO()
7776 my_buff4 = any_object_which_provides_BytesIO_like_interface()
78- results_arr, error_obj = await mrd.download_ranges(
79- my_buff4 = any_object_which_provides_BytesIO_like_interface()
80- results_arr, error_obj = await mrd.download_ranges(
77+ results_arr = await mrd.download_ranges(
8178 [
82- # (start_byte, bytes_to_read, writeable_buffer)
8379 # (start_byte, bytes_to_read, writeable_buffer)
8480 (0, 100, my_buff1),
8581 (100, 20, my_buff2),
8682 (200, 123, my_buff3),
8783 (300, 789, my_buff4),
88- (100, 20, my_buff2),
89- (200, 123, my_buff3),
90- (300, 789, my_buff4),
9184 ]
9285 )
93- if error_obj:
94- print("Error occurred: ")
95- print(error_obj)
96- print(
97- "please issue call to `download_ranges` with updated"
98- "`read_ranges` based on diff of (bytes_requested - bytes_written)"
99- )
100-
101- for result in results_arr:
102- print("downloaded bytes", result)
103-
104- if error_obj:
105- print("Error occurred: ")
106- print(error_obj)
107- print(
108- "please issue call to `download_ranges` with updated"
109- "`read_ranges` based on diff of (bytes_requested - bytes_written)"
110- )
11186
11287 for result in results_arr:
11388 print("downloaded bytes", result)
0 commit comments