Skip to content

Try to avoid reflection usage in IConsume #17

@oskardudycz

Description

@oskardudycz

Per discussion: #7 (comment)

About: https://github.com/oskardudycz/PostgresOutboxPatternWithCDC.NET/blob/3d42e3552956cecfd1773e97a9afd0170ada0937/src/PostgresOutbox/Subscriptions/Subscription.cs#L138

@oskardudycz:

CONCERN: Is this used to call the generic method of the IConsume? If yes, then I'd recommend extending IConsume to have a method accepting an object message, then default implementation in IConsume that would call the typed method. This would reduce the need for this reflection access here, we could just call it.

@lsfera

We might support different scenario.
A truly confident user could simply decide to deal with raw data, hence a basic IConsume would be enough. Or he would rather prefer to work typed data and generics support, hence some sort of (memoized)reflections stuff should unavoidable. Some benchmark here might help in solving the dilemma of reflection adoption.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions