Skip to content

Access full component metadata in ServiceBuilder.RegisterStateStore #37

Open
@olitomlinson

Description

@olitomlinson

Describe the proposal

It would be really convenient if the context object (provided by ServiceBuilder.RegisterStateStore) actually contained all the component metadata on it, as well as just the instanceId.

I ask because in my implementation, at the point of registering my state store, I need the connection string from the metadata, in order to spin up a aspnet hosted BackgroundService which can create some prerequisite tables, that will later be depended on by the usual state store operators (sets, gets etc)

As it stands today, I have to wait until the IPluggableComponent.InitAsync() method is called to get access to the full metadata (MetadataRequest.Properties) so I can access the connection string and then pass it back via a TaskCompletionSource<string> to the BackgroundService. It works, but leads to a messy abstraction.

If you’re with me so far, and agree that making the component metadata available at the point of ServiceBuilder.RegisterStateStore makes sense, then I could suggest we go a step further…. which would make the IPluggableComponent.InitAsync() method completely redundant and could be removed from the API surface.


This is my current implementation :

image
image

But I would like to see something like this :

image
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/proposalA new feature or change is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions