Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconsider :aleph/-namespaced keywords #700

Open
DerGuteMoritz opened this issue Nov 23, 2023 · 3 comments
Open

Reconsider :aleph/-namespaced keywords #700

DerGuteMoritz opened this issue Nov 23, 2023 · 3 comments

Comments

@DerGuteMoritz
Copy link
Collaborator

Problem

Keywords with an :aleph/ namespace are currently used inconsistently: Sometimes the namespace means that the keys are internal (e.g. :aleph/channel), sometimes they are intended for public use and only namespaced to prevent clashes with other keys in the same map (e.g. :aleph/request-arrived).

See #699 (comment) and #699 (comment) for prior discussion which lead to the creation of this issue.

Solution

Still to be determined. One idea we had was to use a different namespace for keys which are indeed not intended for public use (e.g. :aleph.internal/).

Also, we should document :aleph/ keys which are indeed intended for public use.

DerGuteMoritz added a commit that referenced this issue Nov 23, 2023
…y introduced ones

Might later be refined e.g. by namespacing them with :aleph.internal/ instead. See
#700 for future reconsideration.
DerGuteMoritz added a commit that referenced this issue Nov 23, 2023
…y introduced ones

Might later be refined e.g. by namespacing them with :aleph.internal/ instead. See
#700 for future reconsideration.
@KingMob
Copy link
Collaborator

KingMob commented Nov 24, 2023

One thing we could do is stick all internal keys in a map under a single key, like:

{:headers {...}
 :body ...
 :aleph/keep-alive? true
 :aleph/request-arrived some-nano-time
 :aleph/internal {:ch ch 
                  :gory-internal1 ...
                  :gory-internal2 ...}}

I think it's nice and tidy this way.

@DerGuteMoritz
Copy link
Collaborator Author

DerGuteMoritz commented Nov 24, 2023

I think I slightly prefer the flat version because looking up a single internal key is more convenient then (most usage sites are only interested in one of them at a time I think). But the submap approach has the nice advantage that endusers can just dissoc that single key to rid the request map of the gory internals, so there's that.

Another alternative could be to store these in metadata (cf. how it's done for :aleph/channel on streams in the UDP, TCP and websocket implementations).

@KingMob
Copy link
Collaborator

KingMob commented Nov 25, 2023

Flat version is fine, I don't care that much.

Please do not store them in metadata though. I've been wanting to remove that behavior because it violates expectations about what metadata is, and what it's attached to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants