Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3356082
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:28:20+00:00 2026-05-18T02:28:20+00:00

The publisher exposes an event to which multiple subscribers can hook up to on

  • 0

The publisher exposes an event to which multiple subscribers can hook up to

on subscriber side -> publisher.OnSomeEvent += subscriber.CallMe()

Later the subscriber subscribes based on some dynamic arguments

publisher.Subscribe(arguments)

publisher.Unsubscribe(arguments)

Depending on what arguments are passed by the subscriber, I want publisher to update subscribers for the content they have subscribed.

Internally i can maintain a map of subscriber to arguments but my problem is that as event registration and subscription are disconnected i can’t find a good way to pass the callee handle (so i can maintain a map subscriber->arguments) when calling Subscribe/Unsubscribe call.

To keep my API simple i don’t want callee to pass “this”, also as StackFrame and diagnostics API does not work in release mode because of inlining issue, i can’t think of a better design.

Appreciate your help if you can suggest a better way to achieve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T02:28:21+00:00Added an answer on May 18, 2026 at 2:28 am

    This isn’t the most elegant solution, but you could have the publisher deal with the subscriber through an interface which would decouple the publisher from needing to know about any specific subscriber implementation.

    For example

    interface ISubscriber
    {
    object Arguments{get;}
    }
    

    Which would make the client API signature:

    void Subscribe(ISubscriber subscriber)
    

    Of course you may want to implement the interface on a seperate type if you don’t want your subscriber types having an Arguments property.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have an NServiceBus 3.0 publisher running under the production profile. When a subscriber
In NSB 2.6 when you define your publisher you can specify the <DBSubscriptionStorageConfig/> configuration
In Oracle BI Publisher, I can't seem to find in what format the date
I created a very simple event publisher and it looks like this. public class
Publisher - Subscriber pattern where subsriber invoke a service. Server as a Publisher, registered
I am writing a simple server (publisher) and client (subscriber) application to imagine inter-process
Am working with django Publisher example, I want to list all the publishers in
I created two tables: Publisher PK, PublisherId, int, not null, indentity +1 PublisherName, varchar(50),
Here's my code: class Publisher(models.Model): name = models.CharField( max_length = 200, unique = True,
I'm trying to add a publisher policy file to the gac as per this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.