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

Extend PublishEvent #104

Closed
Skarm opened this issue Apr 27, 2020 · 4 comments
Closed

Extend PublishEvent #104

Skarm opened this issue Apr 27, 2020 · 4 comments

Comments

@Skarm
Copy link
Contributor

Skarm commented Apr 27, 2020

Good time of day.
Is it possible to add StreamPosition to a PublishEvent?

client.On().Publish(func(e centrifuge.PublishEvent) centrifuge.PublishReply {
...
offset := e.StreamPosition.Offset
...
}
@FZambia
Copy link
Member

FZambia commented Apr 27, 2020

Hello, I suppose no, because this operation happens before message actually published to Engine.

@FZambia
Copy link
Member

FZambia commented Apr 27, 2020

Which problem you want to solve btw?

@Skarm
Copy link
Contributor Author

Skarm commented May 2, 2020

So that it's possible to get StreamPosition and use the values, for example, when writing to the database or something else.
In case of using the node.Publish(), the function will return StreamPosition.

Yes, with a callback can't get a StreamPosition in the current implementation...

@FZambia
Copy link
Member

FZambia commented May 2, 2020

You can get Offset only after message published to engine (this is already available), Publish callback called before actual publish so on this stage Offset is simply not available. Closing since I don't think we can do something here (and don't understand why we actually should).

@FZambia FZambia closed this as completed May 2, 2020
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