-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscratch.sc
74 lines (67 loc) · 1.83 KB
/
scratch.sc
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
import io.github.edefritz.client.Tile38Client
import io.github.edefritz.commands.GetCommand
import scala.concurrent.Await
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration.DurationInt
import scala.language.postfixOps
import scala.util.{Failure, Success}
val connection = "redis://localhost:9851"
val client = new Tile38Client(connection)
client.execSync(GetCommand("fleet", "truck1", point = true))
/*val set = client.set("fleet", "1").point(1,2).exec()
//val a = Await.result(client.scan("fleet").asPoints(), 2.seconds)
val b = Await.result(client.fset("fleet", "1", Map("c" -> 1.0)).exec(), 2.seconds)
client.close()*/
//
//val pointSet = client
// .set("fleet", "2")
// .withFields(Map("myField" -> 111, "myOtherField" -> 222))
// .ex(100)
// .point(1,2)
// .nx()
// .exec()
//
//val boundsSet = client
// .set("fleet", "2")
// .bounds(1,2,1,2)
// .exec()
//
//val hashSet = client
// .set("fleet", "2")
// .hash("u32hb")
// .exec()
//
//val stringSet = client
// .set("fleet", "2")
// .string("asd")
// .exec()
//
//
//val objectSet = client
// .set("fleet", "2")
// .withFields(Map("myField" -> 1111))
// .ex(10)
// .geojson(
// "{\"type\": \"Feature\", \"properties\": {}, \"geometry\": {\"type\": \"Point\", \"coordinates\": [11.25, 52.9]}}"
//)
// .exec()
//
//
//
//val obj = client.get("fleet", "2").withFields().asPoint()
//val hash = client.get("fleet", "2").withFields().asHash(5)
//
//val obj2 = client.get("fleet", "2").asObject()
//val point = client.get("fleet", "2").asPoint()
//val bounds = client.get("fleet", "2").asBounds()
//
//bounds.onComplete {
// case Success(t) => println(t)
// case Failure(e) => println(e)
//}
//
//val fields = client.get("fleet", "2").withFields().asObject()
//
//val errorHash = client.get("flee", "2").withFields().asHash(5)
//
//client.close()