7#include <glibmm/spawn.h>
47 ComputeThread(
int server_port=0, std::string
token=
"", std::string ip_address=
"127.0.0.1");
99 bool complete(DTree::iterator,
int pos,
int alternative);
141 void on_fail(
const boost::beast::error_code&);
Base class which talks to the server and sends Action objects back to the DocumentThread.
Definition ComputeThread.hh:42
void init()
Definition ComputeThread.cc:49
void try_connect()
Definition ComputeThread.cc:54
void stop()
Stop the current cell execution on the server and remove all other cells from the run queue as well.
Definition ComputeThread.cc:674
void update_variable_on_server(std::string variable, double value)
Update a variable in the kernel.
Definition ComputeThread.cc:648
~ComputeThread()
Definition ComputeThread.cc:38
std::thread::id gui_thread_id
Definition ComputeThread.hh:123
std::string authentication_token
Definition ComputeThread.hh:163
std::string forced_server_ip_address
Definition ComputeThread.hh:166
void run()
Main entry point, which will connect to the server and then start an event loop to handle communicati...
Definition ComputeThread.cc:70
Glib::Pid server_pid
Definition ComputeThread.hh:160
void on_open()
Definition ComputeThread.cc:262
std::string forced_server_token
Definition ComputeThread.hh:165
void on_close()
Definition ComputeThread.cc:291
bool kernel_is_connected() const
Return the status of the connection to the kernel.
Definition ComputeThread.cc:142
void kill_server()
Terminate the server we spawned ourselves, if any, and release its handles.
Definition ComputeThread.cc:84
void restart_kernel()
Restart the kernel.
Definition ComputeThread.cc:701
ComputeThread(const ComputeThread &)=delete
bool connection_is_open
Definition ComputeThread.hh:135
int server_stdout
Definition ComputeThread.hh:161
bool restarting_kernel
Definition ComputeThread.hh:135
int forced_server_port
Definition ComputeThread.hh:164
void terminate()
Terminate the compute thread, in preparation for shutting down the client altogether.
Definition ComputeThread.cc:127
void cell_finished_running(DataCell::id_t)
Definition ComputeThread.cc:310
void try_spawn_server()
Definition ComputeThread.cc:184
GUIBase * gui
Definition ComputeThread.hh:117
websocket_client wsclient
Definition ComputeThread.hh:134
DocumentThread * docthread
Definition ComputeThread.hh:118
std::set< uint64_t > interactive_cells
Definition ComputeThread.hh:151
int number_of_cells_executing(void) const
Definition ComputeThread.cc:669
void on_fail(const boost::beast::error_code &)
Definition ComputeThread.cc:161
std::map< DataCell::id_t, int > running_cells
Definition ComputeThread.hh:131
void all_cells_nonrunning()
Set all cells to be non-running (e.g.
Definition ComputeThread.cc:147
void set_master(GUIBase *, DocumentThread *)
Determine the objects that this compute thread should be talking to.
Definition ComputeThread.cc:43
void execute_interactive(uint64_t id, const std::string &code)
Definition ComputeThread.cc:536
void on_message(const std::string &msg)
Definition ComputeThread.cc:335
int server_stderr
Definition ComputeThread.hh:161
void execute_cell(DTree::iterator, std::string no_assign="", std::vector< uint64_t > output_cell_ids=std::vector< uint64_t >())
In order to execute code on the server, call the following from the GUI thread.
Definition ComputeThread.cc:566
unsigned short port
Definition ComputeThread.hh:162
Each cell is identified by a serial number 'id' which is used to keep track of it across network call...
Definition DataCell.hh:53
A base class with all the logic to manipulate a Cadabra notebook document.
Definition DocumentThread.hh:41
Abstract base class with methods that need to be implemented by any GUI.
Definition GUIBase.hh:16
Complete a set of coordinate rules so that they also cover related tensors.
Definition complete.hh:14
Definition websocket_client.hh:15
Functions to handle the exchange properties of two or more symbols in a product.
Definition Adjform.cc:83
void set(rset_t::iterator &num, multiplier_t fac)
Definition Storage.cc:1180