Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

It is possible and useful to have There may be scenarios where it makes sense to connect to multiple space connections running simultaneously within concurrently in a single session. One could have a connected space dedicated to persistent RTC connection for communication while using another connection for loading snapshots of a space, perhaps viewing various journaled configurations of a car prototype. This is achieved by using Tags, which are user-defined identifiers for a CavrnusSpaceConnection.

...

Code Block
languagec#
  public void Start()
  {
      CavrnusFunctionLibrary.AwaitAuthentication(auth => {
          var configA = new CavrnusSpaceConnectionConfig {Tag = "A"};
          CavrnusFunctionLibrary.JoinSpaceWithOptions("Space-A", configA, print, print);
          
          var configB = new CavrnusSpaceConnectionConfig {Tag = "B"};
          CavrnusFunctionLibrary.JoinSpaceWithOptions("Space-B", configB, print, print);
      });
      
      CavrnusFunctionLibrary.AwaitSpaceConnectionByTag("A", spaceConnection => {
          print("Space A is now connected!");
      });
      
      CavrnusFunctionLibrary.AwaitSpaceConnectionByTag("B", spaceConnection => {
          print("Space B is now connected!");
      });
    }
  }

...