ten::handle class
[scpubgit/TenDotTcl.git] / ten / ten.tcl
index 3abe931..988915d 100644 (file)
@@ -249,4 +249,17 @@ snit::type ten::read_channel {
   }
 }
 
+snit::type ten::handle {
+  option -connection
+  option -id
+
+  method call {name args} {
+    return [[$self start $name {*}$args] await_get]
+  }
+
+  method start {name args} {
+    $options(-connection) send call [json::write string $options(-id)] 0 [json::write string $name] {*}$args
+  }
+}
+
 package provide ten 0.0.1