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

Better documentation/example about BatchController #689

Open
vorner opened this issue Feb 27, 2020 · 2 comments
Open

Better documentation/example about BatchController #689

vorner opened this issue Feb 27, 2020 · 2 comments

Comments

@vorner
Copy link
Contributor

vorner commented Feb 27, 2020

Description

I wanted to make bunch of systems conditional (eg. running them only when the game is not paused). I thought I'd use the DispatcherBuilder::with_batch and decide if I want to call a sub-dispatcher in the controller.

But I'm not entirely sure how it is supposed to work. The Safety section of the create method isn't really clear on what must be uphold. What is „correctly constructed BatchAccessor“?

Furthermore, it references examples/batch_dispatching.rs, which doesn't exist (at least not on master).

So I'd like to ask if it's possible to describe how this thing works in some better way/add the missing example. Or am I trying to use the wrong tool for the job? Shouldn't something like enabling/disabling bunch of systems be possible without using unsafe?

I'm trying to wrap my head around how I would use the BatchController.

(I'm not sure if this belongs more into the feature or bug category, to be honest)

@azriel91
Copy link
Member

TODO: check amethyst/shred#144 and amethyst/shred#147
(have to do this later -- am overloaded right now)

@vorner
Copy link
Contributor Author

vorner commented Feb 28, 2020

I see the example lives in the shred repository. Might this be caused by specs re-exporting the types? I'll try to read through that and try to improve the docs a bit ‒ at least by linking the example directly.

bors bot added a commit to amethyst/shred that referenced this issue May 27, 2020
196: Improve docs of BatchController r=azriel91 a=vorner

* Clarify safety of the `create` method.
* Link directly to the example on github; this saves some time searching
  for it and it also avoids confusion in which repository the example
  lives, as the trait is re-exported in `specs`.

Related to amethyst/specs#689.

Please do check that what I state here is correct. It's gathered from reading other documentation and trying to understand it as a user of the library, but I didn't write the code.

I'm not updating the changelog, since there's no actual code change, just some documentation improvements. If you think this still requires an entry, I'll add it.

Also, am I right to assume that if I register a batch that contains some thread-local systems, they'll still be handled as `!Send` internally and nothing will allow the user to move them to a different thread, etc?

Co-authored-by: Michal 'vorner' Vaner <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants