Try to make XML compatible with what is used at Evri
understand how to make this HA using multiple Erlang nodes
One way might be to use the gb_tree module and add expiration times as services are added. But assuming processes really are cheap as advertised, an interesting and simple first-pass solution is to spawn a process for each service when registered that waits to remove it. It would need to check before removing that the expiry has not been updated. There is also the problem that if the server crashes then these processes don’t have a way to restart. An eventually consistent approach could have a cleaner process that checks for expired processes once a minute, say, in addition to per service cleaners.
Name | Description | Type | Default |
---|---|---|---|
id | hash of type, group, and URL | string | - |
type | name of service type | string | - |
group | group name | string | ”” |
proto | protocal | string | “http” |
host | host name | string | - |
port | port number | int | 80 |
path | service path | string | ”” |
attrs | key/value attributes | list of {k, v} | [] |
expiry | expiration time sec from epoch | long | 0 |
lease | lease time in seconds | int | 300 |
Name Description id unique id based on hash of service type and URL