Logo
Explore Help
Sign In
factotum/nats.zig
1
Fork 0
You've already forked nats.zig
Code Issues Pull Requests Packages Projects Releases Wiki Activity
nats.zig/examples/pub_bytes.zig

11 lines
296 B
Zig
Raw Normal View History

examples: add pub_bytes This was the point that I realized there's no reason to have the string variants of the publishing methods. But also there's not really much point in porting the other getting-started examples, since we've covered all their functionality in the existing examples (actually, this one is redundant too, but I have already done it, so it's getting grandfathered in). Porting some of the more interesting examples might be a good idea, but those have a weird argument parser that I don't really want to port (even though it is very simple in the way that it works). For the most part, I think writing unit tests will do a better of flexing the bindings.
2023-08-23 22:35:15 -07:00
const std = @import("std");
const nats = @import("nats");
pub fn main() !void {
const connection = try nats.Connection.connectTo(nats.default_server_url);
defer connection.destroy();
const data = [_]u8{ 104, 101, 108, 108, 111, 33 };
try connection.publish("subject", &data);
}
Reference in New Issue Copy Permalink
Powered by Gitea
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API