Class: Polars::InProcessQuery

Inherits:
Object
  • Object
show all
Defined in:
lib/polars/in_process_query.rb

Overview

A placeholder for an in process query.

This can be used to do something else while a query is running. The queries can be cancelled. You can peek if the query is finished, or you can await the result.

Instance Method Summary collapse

Constructor Details

#initialize(ipq) ⇒ InProcessQuery

Returns a new instance of InProcessQuery.



11
12
13
# File 'lib/polars/in_process_query.rb', line 11

def initialize(ipq)
  self._inner = ipq
end

Instance Method Details

#cancelObject

Cancel the query at earliest convenience.



16
17
18
# File 'lib/polars/in_process_query.rb', line 16

def cancel
  _inner.cancel
end

#fetchObject

Fetch the result.

If it is ready, a materialized DataFrame is returned. If it is not ready it will return nil.



24
25
26
27
28
29
30
# File 'lib/polars/in_process_query.rb', line 24

def fetch
  if !(out = _inner.fetch).nil?
    Utils.wrap_df(out)
  else
    nil
  end
end

#fetch_blockingObject

Await the result synchronously.



33
34
35
# File 'lib/polars/in_process_query.rb', line 33

def fetch_blocking
  Utils.wrap_df(_inner.fetch_blocking)
end