reduce docs
This commit is contained in:
@@ -959,25 +959,14 @@ function send_batch(sender::SensorSender, readings::Vector{SensorReading})
|
||||
|
||||
arrow_data = take!(buf)
|
||||
|
||||
# Send based on size
|
||||
if length(arrow_data) < 1048576 # < 1MB
|
||||
data = [("batch", arrow_data, "table")]
|
||||
smartsend(
|
||||
"/sensors/batch",
|
||||
data,
|
||||
broker_url=sender.broker_url,
|
||||
fileserver_url=sender.fileserver_url
|
||||
)
|
||||
else
|
||||
# Upload to file server
|
||||
data = [("batch", arrow_data, "table")]
|
||||
smartsend(
|
||||
"/sensors/batch",
|
||||
data,
|
||||
broker_url=sender.broker_url,
|
||||
fileserver_url=sender.fileserver_url
|
||||
)
|
||||
end
|
||||
# Send based on size (auto-selected by smartsend)
|
||||
data = [("batch", arrow_data, "arrowtable")]
|
||||
smartsend(
|
||||
"/sensors/batch",
|
||||
data,
|
||||
broker_url=sender.broker_url,
|
||||
fileserver_url=sender.fileserver_url
|
||||
)
|
||||
end
|
||||
```
|
||||
|
||||
@@ -1037,28 +1026,16 @@ class SensorSender {
|
||||
const buffer = arrow.tableFromBatches([recordBatch]).toBuffer();
|
||||
const arrow_data = new Uint8Array(buffer);
|
||||
|
||||
// Send based on size
|
||||
if (arrow_data.length < 1048576) {
|
||||
const data = [["batch", arrow_data, "table"]];
|
||||
await NATSBridge.smartsend(
|
||||
"/sensors/batch",
|
||||
data,
|
||||
{
|
||||
broker_url: this.broker_url,
|
||||
fileserver_url: this.fileserver_url
|
||||
}
|
||||
);
|
||||
} else {
|
||||
const data = [["batch", arrow_data, "table"]];
|
||||
await NATSBridge.smartsend(
|
||||
"/sensors/batch",
|
||||
data,
|
||||
{
|
||||
broker_url: this.broker_url,
|
||||
fileserver_url: this.fileserver_url
|
||||
}
|
||||
);
|
||||
}
|
||||
// Send based on size (auto-selected by smartsend)
|
||||
const data = [["batch", arrow_data, "arrowtable"]];
|
||||
await NATSBridge.smartsend(
|
||||
"/sensors/batch",
|
||||
data,
|
||||
{
|
||||
broker_url: this.broker_url,
|
||||
fileserver_url: this.fileserver_url
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1109,7 +1086,7 @@ class SensorSender:
|
||||
arrow_data = buf.getvalue()
|
||||
|
||||
# Send based on size (auto-selected by smartsend)
|
||||
data = [("batch", arrow_data, "table")]
|
||||
data = [("batch", arrow_data, "arrowtable")]
|
||||
await smartsend(
|
||||
"/sensors/batch",
|
||||
data,
|
||||
@@ -1152,7 +1129,7 @@ function send_batch_readings(sender::SensorSender, readings::Vector{Tuple{String
|
||||
# Send as single message
|
||||
smartsend(
|
||||
"/sensors/batch",
|
||||
[("batch", arrow_data, "table")],
|
||||
[("batch", arrow_data, "arrowtable")],
|
||||
broker_url=sender.broker_url
|
||||
)
|
||||
end
|
||||
@@ -1193,7 +1170,7 @@ async function sendBatchReadings(sender, readings) {
|
||||
const arrow_data = new Uint8Array(buffer);
|
||||
|
||||
// Send as single message
|
||||
const data = [["batch", arrow_data, "table"]];
|
||||
const data = [["batch", arrow_data, "arrowtable"]];
|
||||
await NATSBridge.smartsend(
|
||||
"/sensors/batch",
|
||||
data,
|
||||
@@ -1398,4 +1375,4 @@ For more information, check the [API documentation](../src/README.md) and [test
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
MIT
|
||||
|
||||
Reference in New Issue
Block a user