7 Commits

Author SHA1 Message Date
226d678e68
examples: make request_reply slightly more interesting 2023-08-24 20:23:19 -07:00
2e06f44aa8
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:27 -07:00
65ab46f714
connection: eliminate String method variants
After contemplating this for a little bit, there's no point in exposing
these separately from the plain variants. Even nats.c internally calls
its plain variants after calling `strlen` on the input. Zig benefits
from having nicer pointer types than C, so we get "string" handling
for free from the fact that the standard variants take slices anyway.
2023-08-23 22:27:33 -07:00
18205a5533
examples: add statistics to request_reply
I should probably write some tests instead.
2023-08-23 22:18:45 -07:00
b101e0acd2
message: more iterators, less problems
This seems like a pretty nice way to do this, since it lets us produce
the sliced version of each value rather than the somewhat janky many
pointer.
2023-08-23 22:03:25 -07:00
ebd3e64111
examples: port header example to zig
This looks a lot nicer than its c counterpart, in my opinion.
2023-08-23 01:05:37 -07:00
48962f27d9
add examples and integrate into build
I suppose the next step will be to translate the C examples into their
zig counterparts. This is also good dog food.
2023-08-21 23:51:58 -07:00