Hello Swift Community!
I'm Ayushi, based in Toronto, and a recent graduate from the University of Waterloo! This summer, I'm excited to be working on Swift-etcd: A Native Client for Seamless Integration with etcd Servers as a GSoC contributor, alongside my mentor @FranzBusch. Our mission is to develop a native Swift-etcd client that seamlessly integrates etcd, a distributed key-value store, into Swift applications.
Our primary objective is to harness the power of grpc-swift to facilitate authentication, key-value operations, watch operations, and lease management, ensuring a seamless and efficient communication channel between Swift services and etcd servers.
I'd like to kick off a thread to update the community on my progress, provide regular updates and to get feedback and insights from all of you!
Thanks a lot,
Ayushi
17 Likes
ayushi2103
(Ayushi Tiwari)
2
Hello Swift Community,
I wanted to share an update for the GSoC project - Swift ETCD Client. I have implemented the core functions for interacting with etcd: get, set, put, and delete. These functions allow Swift developers to interact with etcd via a Swift API.
Get: Retrieves the value of a specified key from the etcd store.
Set: Updates the value of an existing key or creates a new key-value pair if it doesn't exist.
Put: Similar to set, but designed for batch operations to enhance performance.
Delete: Removes a specified key and its associated value from the store.
I am now focusing on implementing the watch operation. This feature will enable real-time monitoring of changes to specific keys within the etcd store. Through the watch operation, applications can react dynamically to changes.
Below, is a code snippet outlining how the get/set/put/delete functions work.
import NIO
let etcdClient = EtcdClient(host: "localhost", port: 2379, eventLoopGroup: .singleton)
try await etcdClient.set("foo", value: "bar")
var value = try await etcdClient.get("foo")
print("Value after set: \(value)")
try await etcdClient.put("foo", value: "baz")
value = try await etcdClient.get("foo")
print("Value after put: \(value)")
try await etcdClient.delete("foo")
print("Key 'foo' deleted")
Regards,
Ayushi Tiwari
7 Likes