@@ -6,23 +6,22 @@ list_r_sessions <- function() {
66  on.exit(nanonext :: reap(sock ))
77  cv  <-  nanonext :: cv()
88  monitor  <-  nanonext :: monitor(sock , cv )
9-   suppressWarnings(
10-     for  (i  in  seq_len(1024L )) {
11-       if  (
12-         nanonext :: dial(
13-           sock ,
14-           url  =  sprintf(" %s%d" acquaint_socket , i ),
15-           autostart  =  NA 
16-         ) && 
17-           i  >  8L 
18-       )
19-         break 
20-     }
21-   )
9+   for  (i  in  seq_len(1024L )) {
10+     if  (
11+       nanonext :: dial(
12+         sock ,
13+         url  =  sprintf(" %s%d" the $ socket_url , i ),
14+         autostart  =  NA ,
15+         fail  =  " none" 
16+       ) && 
17+       i  >  8L 
18+     )
19+       break 
20+   }
2221  pipes  <-  nanonext :: read_monitor(monitor )
2322  res  <-  lapply(
2423    pipes ,
25-     function (x ) nanonext :: recv_aio(sock , mode  =  " string" 
24+     function (x ) nanonext :: recv_aio(sock , mode  =  " string" ,  timeout   =   5000L )
2625  )
2726  lapply(
2827    pipes ,
@@ -47,14 +46,14 @@ list_r_sessions_tool <-
4746    )
4847  )
4948
50- select_r_session  <-  function (i ) {
49+ select_r_session  <-  function (session ) {
5150  nanonext :: reap(the $ server_socket [[" dialer" 1L ]])
5251  attr(the $ server_socket , " dialer" <-  NULL 
5352  nanonext :: dial(
5453    the $ server_socket ,
55-     url  =  sprintf(" %s%d" acquaint_socket , as.integer( i ) )
54+     url  =  sprintf(" %s%d" the $ socket_url ,  session )
5655  )
57-   paste0 (" Selected session " ,  i ,  "   successfully." 
56+   sprintf (" Selected session %d  successfully." ,  session )
5857}
5958
6059select_r_session_tool  <- 
@@ -72,7 +71,7 @@ select_r_session_tool <-
7271      " Your choice of session will persist after the tool is called; only" 
7372      " call this tool more than once if you need to switch between sessions." 
7473    ),
75-     i  =  ellmer :: type_integer(" The index of the  R session to select." 
74+     session  =  ellmer :: type_integer(" The R session number  to select." 
7675  )
7776
7877get_acquaint_tools  <-  function () {
0 commit comments