#name-service #name #service-discovery #discovery #dns #service #thread-pool

ns-std-threaded

Name service implementation for abstract-ns that uses stdlib's implementation run in a thread pool

3 releases (breaking)

Uses old Rust 2015

0.3.0 Oct 19, 2017
0.2.0 Mar 1, 2017
0.1.0 Oct 15, 2016

#15 in #name-service

Download history 20/week @ 2024-07-22 68/week @ 2024-07-29 27/week @ 2024-08-05 29/week @ 2024-08-12 18/week @ 2024-08-19 48/week @ 2024-08-26 12/week @ 2024-09-02 18/week @ 2024-09-09 16/week @ 2024-09-16 63/week @ 2024-09-23 16/week @ 2024-09-30 11/week @ 2024-10-07 13/week @ 2024-10-14 15/week @ 2024-10-21 10/week @ 2024-10-28 26/week @ 2024-11-04

64 downloads per month
Used in 9 crates (7 directly)

MIT/Apache

50KB
854 lines

Abstract Name Service

Status: Beta

Documentation | Github | Crate

This rust crate provides just abstract traits which may be used to build interoperable implementations of name dicovery.

We want abstract_ns to have implementations not only for DNS-based name discovery but also Zookeeper, Eureka, Etcd, Consul, and whatever other thing you might imagine. All of them easily configured and interchangeable.

Features:

  • Defines what is a name and what is a result of service discovery
  • Uses futures-rs for asynchronous stuff
  • Has interface to receive updates (name changes)
  • Allows some kind of name service routing, i.e. has a way to specify different resolvers for different names, for example: serve *.consul from local consul, other names from conventional DNS servers.

This repository also contains the following crates:

  • ns-std-threaded a name resolution implementation that uses stdlib resolver running in a thread pool
  • ns-dns-tokio an pure-rust implementation that uses domain crate to resolve domains asynchronously in tokio-core main loop

Note: abstract-ns v0.2 is very different product than v0.1

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


lib.rs:

This crate provides a simple name resolver that uses lib's name resolution.

Unfortunately libc doesn't provide asyncrhonous name resolution for many reasons so we run requests in a thread pool.

For high-performance server applications this way is far from being performant, still it is the most compatible to everything else. So it might be used:

  1. To provide maximum compatibility (i.e. good default for dev environment)
  2. In applications where name resolution is not slow part
  3. As a fallthrough resolver for ns_router::Router where more frequently used name suffixes are overriden with faster resolver for that namespace

Dependencies

~480–720KB
~10K SLoC