When an event is emitted, is it propagated to all spaces or to just a single space?
The documentation on spaces seems to be very sparse. So far, I have only found documentation that indicates how to specify the space for a Function and a Subscriber, but nothing about how to limit an Event to a specific space.
thanks for the question! We definitely need to work on docs.
Events are not emitted to any specific space. They are emitted on specific path. Which means that you can have two different subscriptions it two different spaces subscribed to “user.created” event on path “/”. It means that every “user.created” event emitted on “/” will invoke both functions.
Let me know if you have more questions!
But having all events be visible across all spaces seems to violate at least the “spirit” of the concept of Spaces in the serverless README. Quotes:
Space is a coarse-grained sandbox
All access cross-space is disabled.
different teams/departments use different spaces for isolation
I don’t see how spaces can be considered sandboxes totally isolated from each other if all events are visible to all spaces. Seems like an enormous hole.
spaces implementation is definitelly not done. We only implemented the first pass of it. We intentionally didn’t bound subscription path with space as it provides some limitations. It doesn’t mean though that we won’t do that in next release. EG is still in early phase, things can change quickly.