RB.ChunkLoader

g GObject.Object GObject.Object RB.ChunkLoader RB.ChunkLoader GObject.Object->RB.ChunkLoader

Subclasses:None

Methods

Inherited:GObject.Object (37)
Structs:GObject.ObjectClass (5)
class new ()
  cancel ()
  get_error ()
  set_callback (callback, *user_data)
  start (uri, chunk_size)

Virtual Methods

Inherited:GObject.Object (7)

Properties

None

Signals

Inherited:GObject.Object (1)

Fields

Inherited:GObject.Object (1)
Name Type Access Description
parent GObject.Object r  

Class Details

class RB.ChunkLoader(**kwargs)
Bases:GObject.Object
Abstract:No
Structure:RB.ChunkLoaderClass
classmethod new()
Returns:RB.ChunkLoader instance
Return type:RB.ChunkLoader

Creates and returns a new RB.ChunkLoader instance.

cancel()

Cancels the loading operation, ensuring that the callback will not be called again.

get_error()
Returns:loader error or None
Return type:GLib.Error

If an error has occurred that prevents the loader from providing any further data, this function will return a GLib.Error, otherwise None.

set_callback(callback, *user_data)
Parameters:

Sets the loader data callback. This will be called with each chunk of data read, or with None to indicate the end of the file or that an error has occurred. To determine which of these is the case, call rb_chunk_loader_get_error.

This must be called before rb_chunk_loader_start.

start(uri, chunk_size)
Parameters:
  • uri (str) – the uri to load
  • chunk_size (int) – maximum chunk size

Starts loading data from the specified URI, passing it in chunks of at most chunk_size to the callback.