pydeephaven.ticket

class ApplicationTicket(ticket_bytes)[source]

Bases: Ticket

An ApplicationTicket is a ticket that references a field of an application on the server. Please refer to the documentation on ‘Application Mode’ for detailed information on applications and their use cases.

Initializes an ApplicationTicket.

Parameters:

ticket_bytes (bytes) – the raw bytes for the ticket

classmethod app_ticket(app_id, field)[source]

Creates an application ticket that references a field of an application.

Parameters:
  • app_id (str) – the application id

  • field (str) – the name of the application field

Return type:

ApplicationTicket

Returns:

an ApplicationTicket

property bytes

Returns the ticket as raw bytes.

property pb_ticket

Returns the ticket as a gRPC protobuf ticket.

class ExportTicket(ticket_bytes)[source]

Bases: Ticket

An ExportTicket is a ticket that references an object exported from the server such as a table or a plugin widget. An exported server object will remain available on the server until the ticket is released or the session is closed. Many types of server objects are exportable and can be fetched to the client as an export ticket or as an instance of wrapper class (such as Table, PluginClient, etc.) that wraps the export ticket. An export ticket can be published to a SharedTicket so that the exported server object can be shared with other sessions.

Note: Users should not create ExportTickets directly. They are managed by the Session and are automatically created when exporting objects from the server via. Session.open_table(), Session.fetch(), and any operations that return a Table.

Initializes an ExportTicket.

Parameters:

ticket_bytes (bytes) – the raw bytes for the ticket

property bytes

Returns the ticket as raw bytes.

classmethod export_ticket(ticket_no)[source]

Creates an export ticket from a ticket number.

Parameters:

ticket_no (int) – the export ticket number

Return type:

ExportTicket

Returns:

an ExportTicket

property pb_ticket

Returns the ticket as a gRPC protobuf ticket.

class ScopeTicket(ticket_bytes)[source]

Bases: Ticket

A ScopeTicket is a ticket that references a scope variable on the server. Scope variables are variables in the global scope of the server and are accessible to all sessions. Scope variables can be fetched to the client as an export ticket or a Deephaven Table that wraps the export ticket.

Initializes a ScopeTicket.

Parameters:

ticket_bytes (bytes) – the raw bytes for the ticket

property bytes

Returns the ticket as raw bytes.

property pb_ticket

Returns the ticket as a gRPC protobuf ticket.

classmethod scope_ticket(name)[source]

Creates a scope ticket that references a scope variable by name.

Parameters:

name (str) – the name of the scope variable

Return type:

ScopeTicket

Returns:

a ScopeTicket

class ServerObject(type, ticket)[source]

Bases: object

A ServerObject is a typed ticket that represents objects existing on the server that can be referenced by the client. It is presently used to enable client API users to send and receive references to server-side plugins.

property pb_ticket

Returns the ticket as a gRPC protobuf ticket object.

property pb_typed_ticket

Returns a protobuf typed ticket, suitable for use in communicating with an ObjectType plugin on the server.

ticket

The ticket that points to the object on the server.

type

The type of the object. May be None, indicating that the instance cannot be connected to or otherwise directly used from the client.

class SharedTicket(ticket_bytes)[source]

Bases: Ticket

A SharedTicket is a ticket that can be shared with other sessions.

Initializes a SharedTicket.

Parameters:

ticket_bytes (bytes) – the raw bytes for the ticket

property bytes

Returns the ticket as raw bytes.

property pb_ticket

Returns the ticket as a gRPC protobuf ticket.

classmethod random_ticket()[source]

Generates a random shared ticket. To minimize the probability of collision, the ticket is made from a generated UUID.

Return type:

SharedTicket

Returns:

a SharedTicket

class Ticket(ticket_bytes)[source]

Bases: ABC

A Ticket references an object on the server.

property bytes

Returns the ticket as raw bytes.

property pb_ticket

Returns the ticket as a gRPC protobuf ticket.