Skip to content

Is it safe to manually call $emit ? #878

@arcanis

Description

@arcanis

Hi,

Use case : I'm sending an ajax query to my server. This server make some process, then emit an event using websockets. I would like to return this event as query response, in order to decrease latency (I don't care if it trigger this event twice).

Can I use something like this ?

var stream = io.connect( ... );

$.get( '/foo', function ( data ) {
    stream.$emit( data.name, data.args );
} );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions