-
Notifications
You must be signed in to change notification settings - Fork 220
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
Start and Stop signal registration for the FlaggedStorage #613
Conversation
Wouldn't setting |
Do you mean that when the emission is false, the parallel joint is allowed? I think that this change doesn't fix or make worse that scenario, because the main point of that issue So I would not consider this as a fix or a partial fix. |
bors try |
🔒 Permission denied Existing reviewers: click here to make jojolepro a reviewer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really sure if this belongs into Specs. It seems to me this is quite a special case.
Why do you want that? It seems to me in this case the requirement stems from unclean design. If you want a more custom storage, please consider making your own instead of adding it to Specs; I'm trying to keep Specs small, and stabilize it. |
The reason is that sometimes a particular Create a new Storage to solve this problem is doable, but mean also copy an paste 80% of the actual If you and the others are ok with it, I can create a new storage type that is capable of start and stop event signaling and so solve that issue. |
@torkleyy However this functionality is not so invasive, and only add a feature that can be useful even out of Amethyst. Is always a good thing be able to |
Hello guys! Any idea about this PR? |
I'm okay with merging this, but if @torkleyy doesn't want to, then it would make sense to create this type of storage in an external crate and use it in amethyst. The main downside is that using an external crate will require more maintenance. |
I waited a bit to hear the @torkleyy thoughts on this; (By the way, I think that use a different crate for this, is not the optimal solution in this case) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we put this under a feature flag? I think it would be fine to merge it when it's disabled by default; the API seems clean enough to do that. Though I still feel more cases will come up where we want to customize FlaggedStorage
.
Yes I can to it.
Is it already disabled by default.
Would you like to use a flag (i32 - bit wise operations) instead of a boolean? |
Re-thinking about your comment, probably your idea is to use the conditional building using the features. Let me know which one |
feature flag = "conditional building" = |
@Jojolepro Thanks for the clarification! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Take this as my approval after addressing my review comment.
@torkleyy Done, now looks much better. |
Morning, any idea about this? |
bors r+ |
613: Start and Stop signal registration for the FlaggedStorage r=WaDelma a=AndreaCatania Sometimes you may want to perform some operations on the storage, but you don't want that these operations produce any event. You can use the function `storage.set_event_emission(false)` to suppress the event writing for of any action. When you want to re activate them you can simply call `storage.set_event_emission(true)` This change will be used to fix this: amethyst/amethyst#1795 ## Checklist * [x] I've added tests for all code changes and additions (where applicable) * [x] I've added a demonstration of the new feature to one or more examples * [x] I've updated the book to reflect my changes * [x] Usage of new public items is shown in the API docs Co-authored-by: Andrea Catania <info@andreacatania.com>
Build succeeded |
Sometimes you may want to perform some operations on the storage, but you don't want
that these operations produce any event.
You can use the function
storage.set_event_emission(false)
to suppress the event writing forof any action. When you want to re activate them you can simply call
storage.set_event_emission(true)
This change will be used to fix this: amethyst/amethyst#1795
Checklist