Comments (5)
The issue with declaring tow #[orchestra::orchestra(..)]
annotated types, with similar subsystems, yields two types of identical name, and a bunch of internal types with identical names than the original ones, but they don't have the same type id from a rustc perspective/are disjunct types. Hence why you run into the issue.
I only have ugly solutions for you. Happy to share if interested. (Hint: Modified import paths in all subsystems based on a feature
-flag, I strongly recommend against that).
from orchestra.
The best approach might be to make the macro #[cfg(feature =.. )]
aware and allow conditional compilation of fields of one orchestra
declarated struct Foo
.
from orchestra.
The best approach might be to make the macro
#[cfg(feature =.. )]
aware and allow conditional compilation of fields of oneorchestra
declaratedstruct Foo
.
So basically we would pass different feature flags depending on whether we compile for cumulus or polkadot and then disable some of the subsystems, but reuse the same orchestra? Did I understand that correctly?
One other solution (also hacky) I was thinking about was to introduce one more abstraction level below the macro level. And then reuse the same code but declare the subsystems separately in cumulus.
from orchestra.
The best approach might be to make the macro
#[cfg(feature =.. )]
aware and allow conditional compilation of fields of oneorchestra
declaratedstruct Foo
.So basically we would pass different feature flags depending on whether we compile for cumulus or polkadot and then disable some of the subsystems, but reuse the same orchestra? Did I understand that correctly?
Yes, that's correct.
One other solution (also hacky) I was thinking about was to introduce one more abstraction level below the macro level. And then reuse the same code but declare the subsystems separately in cumulus.
I am not sure I understand what you mean. Also note, that this is quite a bit of work and would add further complexity to the proc-macro, which is not desirable.
So far, the DummySubsystem
s seem to be the easiest path.
Chaninging the number of subsystems will percolate through quite some code in polkadot (i.e. the overseer down to service and cli due to the impl OverseerGen
which takes args for all subsystems, it's specific to polkadot, still something to consider).
Let me think about this for a few days, I have a hunch where we could go with something like !
/Infallible
as a subsystem of which the orchestra proc-macro is aware.
Let's do a call on Friday~ish?
from orchestra.
Thanks for the help! I think a call might be useful!
from orchestra.
Related Issues (20)
- attempt to get rid of `contextbounds`-proc-macro
- Avoid dependency on consumed message type, generate a marker type
- Possible extractions from the polkadot repo
- Confusing error for unconsumed message
- broadcast_signal: parallelize sending and still use a timeout for completion HOT 2
- Implement per subsystem message_capacity override.
- `CHANNEL_CAPACITY` is unused HOT 9
- Disable signed commits HOT 6
- Consider exposing an `UnboundedMeteredSender` as orchestra handle
- Implement `try_send_message` HOT 1
- Memory bounded channels HOT 2
- Allow subsets of the graph to be printed HOT 2
- Provide separate sinks for signals and messages HOT 2
- dotgraph build errors HOT 1
- Release new crate version HOT 1
- Build failure since 0.3.4 HOT 2
- Remove the timeout system HOT 11
- Version 0.3.7 introduces breaking changes HOT 2
- Add regression tests to prevent breaking changes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from orchestra.