Streams
Supported stream method now available in the SDK are:
- StreamSet
- StreamGet
- StreamVerifiedSet
- StreamVerifiedGet
- StreamScan
- StreamZScan
- StreamHistory
- StreamExecAll
Here an example on how to send a large file and a regular key value to immudb.
It’s possible to specify the chunk size of the stream with WithStreamChunkSize()
method.
Streams is not supported yet in this language SDK. Do you want to make a feature request or help out? Open an issue on Java sdk github project (opens new window)
Streams is not supported yet in this language SDK. Do you want to make a feature request or help out? Open an issue on
Streams is not supported yet in this language SDK. Do you want to make a feature request or help out? Open an issue on .Net sdk github project (opens new window)
If you’re using another development language, please read up on our option.
It’s possible to read returned value chunk by chunk if needed. This grant to the clients capabilities to handle data coming from immudb chunk by chunk
To read chunk by chunk the inner gRPC protobuffer client is needed. Then it’s possible to use kvStreamReceiver
to retrieve the key and a value reader. Such reader will fill provided byte array with received data and will return the number of read bytes or error. If no message is present it returns 0 and io.EOF. If the message is complete it returns 0 and nil, in that case successive calls to Read will returns a new message.
sc := client.GetServiceClient()
if err != nil {
log.Fatal(err)
}
key, vr, err := kvr.Next()
if err != nil {
log.Fatal(err)
}
fmt.Printf("read %s key", key)
chunk := make([]byte, 4096)
l, err := vr.Read(chunk)
if err != nil && err != io.EOF {
log.Fatal(err)
}
if err == io.EOF {
break
}
fmt.Printf("read %d byte\n", l)
Streams is not supported yet in this language SDK. Do you want to make a feature request or help out? Open an issue on Java sdk github project (opens new window)
Streams is not supported yet in this language SDK. Do you want to make a feature request or help out? Open an issue on
Streams is not supported yet in this language SDK. Do you want to make a feature request or help out? Open an issue on Node.js sdk github project (opens new window)
Streams is not supported yet in this language SDK. Do you want to make a feature request or help out? Open an issue on
If you’re using another development language, please read up on our immugw (opens new window) option.