How to use @casual-simulation/causal-tree-client-socketio - 5 common examples

To help you get started, we’ve selected a few @casual-simulation/causal-tree-client-socketio examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github casual-simulation / aux / src / aux-vm-client / partitions / RemoteCausalRepoPartitionFactory.ts View on Github external
export async function createRemoteCausalRepoPartition(
    config: PartitionConfig,
    user: User
): Promise {
    if (config.type === 'remote_causal_repo') {
        const manager = new SocketManager(config.host);
        manager.init();
        const connection = new SocketIOConnectionClient(manager.socket, user);
        const client = new CausalRepoClient(connection);
        const partition = new RemoteCausalRepoPartitionImpl(
            user,
            client,
            config
        );
        await partition.init();
        return partition;
    }
    return undefined;
}
github casual-simulation / aux / src / aux-vm-client / partitions / RemoteCausalRepoPartitionFactory.ts View on Github external
export async function createRemoteCausalRepoPartition(
    config: PartitionConfig,
    user: User
): Promise {
    if (config.type === 'remote_causal_repo') {
        const manager = new SocketManager(config.host);
        manager.init();
        const connection = new SocketIOConnectionClient(manager.socket, user);
        const client = new CausalRepoClient(connection);
        const partition = new RemoteCausalRepoPartitionImpl(
            user,
            client,
            config
        );
        await partition.init();
        return partition;
    }
    return undefined;
}
github casual-simulation / aux / src / aux-vm-client / partitions / RemoteCausalTreePartition.ts View on Github external
options: RemoteCausalTreePartitionOptions,
        user: User,
        config: RemoteCausalTreePartitionConfig
    ) {
        this._treeName = config.treeName;
        this._user = user;
        this._treeOptions = options.treeOptions || {};
        let url = new URL(options.defaultHost);

        this._socketManager = new SocketManager(
            config.host
                ? `${url.protocol}//${config.host}`
                : options.defaultHost
        );

        this._treeManager = new CausalTreeManager(
            this._socketManager,
            auxCausalTreeFactory(),
            options.store,
            options.crypto
        );
    }
github casual-simulation / aux / src / aux-vm / vm / AuxChannel.worker.ts View on Github external
constructor(defaultHost: string, config: AuxConfig) {
        this._config = config;
        this._subs = [];

        let url = new URL(defaultHost);
        this._socketManager = new SocketManager(
            config.host ? `${url.protocol}//${config.host}` : defaultHost
        );
        this._treeManager = new CausalTreeManager(
            this._socketManager.socket,
            auxCausalTreeFactory(),
            new NullCausalTreeStore()
        );
    }
github casual-simulation / aux / src / aux-vm-client / partitions / RemoteCausalTreePartition.ts View on Github external
constructor(
        options: RemoteCausalTreePartitionOptions,
        user: User,
        config: RemoteCausalTreePartitionConfig
    ) {
        this._treeName = config.treeName;
        this._user = user;
        this._treeOptions = options.treeOptions || {};
        let url = new URL(options.defaultHost);

        this._socketManager = new SocketManager(
            config.host
                ? `${url.protocol}//${config.host}`
                : options.defaultHost
        );

        this._treeManager = new CausalTreeManager(
            this._socketManager,
            auxCausalTreeFactory(),
            options.store,
            options.crypto
        );
    }

@casual-simulation/causal-tree-client-socketio

A set of services that can be used to network with @casual-simulation/causal-tree-server-socketio

MIT
Latest version published 2 years ago

Package Health Score

53 / 100
Full package analysis