-
Notifications
You must be signed in to change notification settings - Fork 8
/
kernel.mli
80 lines (60 loc) · 2.19 KB
/
kernel.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
(*
* iocamlserver - IOCaml notebook server
*
* (c) 2014 MicroJamJar Ltd
*
* Author(s): [email protected]
* Description: kernel creation and guid mapping
*
*)
open Iocaml_zmq
type kernel_args =
{
log_file : string ref;
init_file : string ref;
completion : bool ref;
object_info : bool ref;
}
val kernel_args : kernel_args
type kernel =
{
process : Lwt_process.process_none;
guid : string;
(* zmq sockets *)
stdin : unit -> [`Dealer] Lwt_zmq.Socket.t;
control : unit -> [`Dealer] Lwt_zmq.Socket.t;
shell : unit -> [`Dealer] Lwt_zmq.Socket.t;
iopub : unit -> [`Sub] Lwt_zmq.Socket.t;
heartbeat : unit -> [`Req] Lwt_zmq.Socket.t;
}
(*module KMap : Map.S with type key = string*)
module M : sig
val notebook_guid_of_filename : string -> string
val notebook_guid_of_kernel_guid : string -> string
val kernel_guid_of_notebook_guid : string -> string
val kernel_guid_of_kernel : kernel -> string
val kernel_of_notebook_guid : string -> kernel option
val kernel_of_kernel_guid : string -> kernel option
val filename_of_notebook_guid : string -> string
val change_filename : string -> string -> string -> unit
val add_kernel : string -> kernel -> unit
val delete_kernel : string -> unit
val iter_kernels : (string -> kernel -> unit) -> unit
val dump_state : int -> unit
end
(** [resolve_addr host port] will resolve [host] and [port] into
a Unix address info structure suitable for use with sockets. *)
val resolve_addr : string -> int -> Unix.sockaddr
val port_available : string -> int -> bool Lwt.t
val n_ports_available : string -> int -> int -> bool Lwt.t
val write_connection_file :
path:string -> kernel_guid:string -> ip_addr:string ->
zmq_shell_port:int -> zmq_iopub_port:int -> zmq_control_port:int ->
zmq_heartbeat_port:int -> zmq_stdin_port:int -> string
val start_kernel :
zmq:ZMQ.Context.t -> path:string -> notebook_guid:string -> ip_addr:string ->
kernel Lwt.t
val get_kernel :
zmq:ZMQ.Context.t -> path:string -> notebook_guid:string -> ip_addr:string ->
kernel Lwt.t
val close_kernel : string -> unit