Client related classes

Client related classes

Functions

Properties

gpointer client Write / Construct Only
gint gpu-device Read / Write / Construct
gint n-retries Read / Write / Construct

Types and Values

Object Hierarchy

    GObject
    ├── GPlasmaClient
    ├── GPlasmaClientCreateOptions
    ╰── GPlasmaClientOptions

Includes

#include <plasma-glib/plasma-glib.h>

Description

GPlasmaClientOptions is a class for customizing plasma store connection.

GPlasmaClientCreateOptions is a class for customizing object creation.

GPlasmaClient is a class for an interface with a plasma store.

Functions

gplasma_client_options_new ()

GPlasmaClientOptions *
gplasma_client_options_new (void);

Returns

A newly created GPlasmaClientOptions.

Since: 0.12.0


gplasma_client_options_set_n_retries ()

void
gplasma_client_options_set_n_retries (GPlasmaClientOptions *options,
                                      gint n_retries);

Parameters

options

A GPlasmaClientOptions.

 

n_retries

The number of retires on connect.

 

Since: 0.12.0


gplasma_client_options_get_n_retries ()

gint
gplasma_client_options_get_n_retries (GPlasmaClientOptions *options);

Parameters

options

A GPlasmaClientOptions.

 

Returns

The number of retries on connect.

Since: 0.12.0


gplasma_client_create_options_new ()

GPlasmaClientCreateOptions *
gplasma_client_create_options_new (void);

Returns

A newly created GPlasmaClientCreateOptions.

Since: 0.12.0


gplasma_client_create_options_set_metadata ()

void
gplasma_client_create_options_set_metadata
                               (GPlasmaClientCreateOptions *options,
                                const guint8 *metadata,
                                gsize size);

Parameters

options

A GPlasmaClientCreateOptions.

 

metadata

The metadata of a created object.

[nullable][array length=size]

size

The number of bytes of the metadata.

 

Since: 0.12.0


gplasma_client_create_options_get_metadata ()

const guint8 *
gplasma_client_create_options_get_metadata
                               (GPlasmaClientCreateOptions *options,
                                gsize *size);

Parameters

options

A GPlasmaClientCreateOptions.

 

size

The number of bytes of the metadata.

[nullable][out]

Returns

The metadata of a created object.

[nullable][array length=size]

Since: 0.12.0


gplasma_client_new ()

GPlasmaClient *
gplasma_client_new (const gchar *store_socket_name,
                    GPlasmaClientOptions *options,
                    GError **error);

Parameters

store_socket_name

The name of the UNIX domain socket.

 

options

The options to custom how to connect to plasma store.

[nullable]

error

Return location for a GError or NULL.

[nullable]

Returns

A newly created GPlasmaClient on success, NULL on error.

[nullable]

Since: 0.12.0


gplasma_client_create ()

GPlasmaCreatedObject *
gplasma_client_create (GPlasmaClient *client,
                       GPlasmaObjectID *id,
                       gsize data_size,
                       GPlasmaClientCreateOptions *options,
                       GError **error);

Parameters

client

A GPlasmaClient.

 

id

The ID for a newly created object.

 

data_size

The number of bytes of data for a newly created object.

 

options

The option for creating an object.

[nullable]

error

Return location for a GError or NULL.

[nullable]

Returns

A newly created GPlasmaCreatedObject on success, NULL on error.

[nullable][transfer full]

Since: 0.12.0


gplasma_client_refer_object ()

GPlasmaReferredObject *
gplasma_client_refer_object (GPlasmaClient *client,
                             GPlasmaObjectID *id,
                             gint64 timeout_ms,
                             GError **error);

Parameters

client

A GPlasmaClient.

 

id

The ID of the target object.

 

timeout_ms

The timeout in milliseconds. -1 means no timeout.

 

error

Return location for a GError or NULL.

[nullable]

Returns

A found GPlasmaReferredObject on success, NULL on error.

[nullable][transfer full]

Since: 0.12.0


gplasma_client_disconnect ()

gboolean
gplasma_client_disconnect (GPlasmaClient *client,
                           GError **error);

Parameters

client

A GPlasmaClient.

 

error

Return location for a GError or NULL.

[nullable]

Returns

TRUE on success, FALSE if there was an error.

Since: 0.12.0

Types and Values

GPLASMA_TYPE_CLIENT_OPTIONS

#define GPLASMA_TYPE_CLIENT_OPTIONS (gplasma_client_options_get_type())

struct GPlasmaClientOptionsClass

struct GPlasmaClientOptionsClass {
  GObjectClass parent_class;
};

GPLASMA_TYPE_CLIENT_CREATE_OPTIONS

#define             GPLASMA_TYPE_CLIENT_CREATE_OPTIONS

struct GPlasmaClientCreateOptionsClass

struct GPlasmaClientCreateOptionsClass {
  GObjectClass parent_class;
};

GPLASMA_TYPE_CLIENT

#define GPLASMA_TYPE_CLIENT (gplasma_client_get_type())

struct GPlasmaClientClass

struct GPlasmaClientClass {
  GObjectClass parent_class;
};

GPlasmaClient

typedef struct _GPlasmaClient GPlasmaClient;

GPlasmaClientCreateOptions

typedef struct _GPlasmaClientCreateOptions GPlasmaClientCreateOptions;

GPlasmaClientOptions

typedef struct _GPlasmaClientOptions GPlasmaClientOptions;

Property Details

The “client” property

  “client”                   gpointer

The raw plasma::PlasmaClient *.

Owner: GPlasmaClient

Flags: Write / Construct Only


The “gpu-device” property

  “gpu-device”               gint

The GPU device number. -1 means GPU isn't used.

Owner: GPlasmaClientCreateOptions

Flags: Read / Write / Construct

Allowed values: >= -1

Default value: -1


The “n-retries” property

  “n-retries”                gint

The number of retries to connect plasma store. -1 means that the system default value is used.

Owner: GPlasmaClientOptions

Flags: Read / Write / Construct

Allowed values: >= -1

Default value: -1