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

implement event subscriptions #357

Closed
championswimmer opened this issue Aug 15, 2018 · 6 comments

Comments

Projects
None yet
6 participants
@championswimmer
Copy link
Member

commented Aug 15, 2018

create following files

  • /src/events/users
  • /src/events/demographics

they should export functions like

eventUserCreated(userId)
eventUserUpdated(userId)
eventDemographicsCreated(demoId, userId)

these should be async functions so that they can run non blocking.

the purpose of these functions would be like this -

function eventUserCreated(userId) {
   // find all EventSubscriptions that exist for {user, created}
   // make a POST request to all the webhookURL for all such clients
}

payload of post request should have nominal data like ids

{
  type: "CREATED",
  model: "user",
  success: true,
  id: 1,
  userId: 1   
}

in case of user model events, id and userId will be same only

{
  type: "UPDATED",
  model: "address",
  success: true,
  id: 10,
  userId: 1

}

these functions like eventUserCreated should be called from controller for user creation.

The controller should NOT await for event function. The event is fired and forgotten, if the event is not reported, the controller should not get stuck for that.

@firefinchdev

This comment has been minimized.

Copy link
Contributor

commented Aug 15, 2018

I will be working on this

@VibhorCodecianGupta

This comment has been minimized.

Copy link
Collaborator

commented Sep 8, 2018

@championswimmer is this 100% done? In case there's anything left, I can contribute.

@crownedlake

This comment has been minimized.

Copy link

commented Feb 27, 2019

Is this still open?

@rakshitkumarcse

This comment has been minimized.

Copy link

commented May 13, 2019

Is this issue still open? @VibhorCodecianGupta @championswimmer

@championswimmer

This comment has been minimized.

Copy link
Member Author

commented May 19, 2019

@Manit1
Pardon us, actually there was some mixup with the bounties. This issue is worth 2000 and ther UI is worth 2000 separately.

I am fixing the labels for the same.

@Manit1

This comment has been minimized.

Copy link
Contributor

commented May 19, 2019

@championswimmer No problem! I enjoyed working on the issue 😄 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.