Giter VIP home page Giter VIP logo

meteor-streams's Introduction

Meteor Streams Build Status

DB less realtime communication for meteor

Development Status

Project development status is inactive.

Meteor Streams - DB less realtime communication for meteor

meteor-streams's People

Contributors

arunoda avatar brylie avatar matteodem avatar nadee013 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

meteor-streams's Issues

Trouble Adding Rooms

Hey everyone,

I was wondering if this method would be even possible using streams but is it possible to add rooms? I have tried several different ways but I am having trouble getting it to work. Do I need to add clusters? Any help would be greatly appreciated!

Target a specific client from the server.

This is not really an issue but I can't seem find help anywhere else.

I'm creating a simple multiplayer pong game with 2 players.

Each player should only be able to control their respective paddle. So in theory I would send a message to client 1 saying 'control_paddle_one' to client 2 I would send 'control_paddle_two'.

I did this in socket.io by using io.sockets.socket(id).emit('message').

Is there a way to accomplish this using streams?

Thank you!

Making use of Meteor Streams as Message Threads

Having an issue integrating Meteor-Streams to the application i am creating. The design i am doing is much more similar to Streaming Private Page communication pattern. What will happen is that i have 2 text area with TO and the Message. In the TO field it is the recipient of the message and the MESSAGE field is the main message.

Issue: Meteor-Streams should only send the message to the designated recipient on the TO FIELD, NOT ALL USERS THAT IS ACTIVE. Is there a way on how will i approach this?

code doesn't work

chatStream = new Meteor.Stream('chat');

if(Meteor.isClient) {
sendChat = function(message) {
chatStream.emit('message', message);
console.log('me: ' + message);
};

chatStream.on('message', function(message) {
console.log('user: ' + message);
});
}

There was a large blurb about autopublish being enabled so I removed it. However, I tried it with autopublish and it didn't work.

I'm using the latest meteor version 0.6.4.1

Git push?

Looks like the package has been published to Atmosphere in in August 2014, but the last commit here is from Sep 2013?

Also, would be nice to add the git URL to package.js so the README shows up at https://atmospherejs.com/arunoda/streams

Docs on API

Currently there is no such API doc on the docs site. Add it.

Handle disconnect events

While looking at the source, I have found that there are undocumented client disconnection handlers in ther server code, but I can't find a way to use them.

Can you give an example on how they should be implemented?

send frequent data to clients

HI Arunoda :

I need to send values of a counter on server side which gets changed evey 80 miliseconds to all clients. The reason for this is to move an object on a canvas for all clients base on this counter. I used MongoDb and Publish /Subscribe first . But I am not getting some of the updates to the server side counter in clients . So I need another solution and I ran into Your stream package. Before implementing it, wanted to see if this is the right solution or you know of any better supported mechanism .

Thanks for your suggestions.

Optimization: customize the publish/subscribe methods

Is there some way we could customize the publish/subscribe methods for the collection?

In my use case, I only need to monitor messages dependant on a Session variable.

That is, 95% of my clients don't care at all, and wont render/act upon any notifications.

Were this a normal publish/subscribe, I could base the subscribe upon the Session variables.

While the code runs fine, with the Session variable restrictions being handled in the on() handler, it's not optimal. All clients are getting all messages

And yes, I know I can restrict based on the Meteor.userId but in the case of this app, most clients are anon.

Error: This socket has been ended by the other party

I've built a complex app with Meteor Streams for creating shared web IDE sessions, and running server languages (ex: Java) through this code editor by sending the code and then getting back the execution result from the server.

So inside the execution of the app (the one the user wrote in their IDE) I'm listening to a stream event to handle server side I/O apps in real-time, however, this works fine in the first run, but when re-running the app (using the same event), I get the error "Error: This socket has been ended by the other party" which is an exception and it stops the execution there.

Is there any ideas on this issue, why is it happening? and is there a way to re-connect to the stream/socket when it's ended or closed?

i have failed to add meteor streams to my project

I have failed to add the meteor streams to my projects
using meteor add streams but iam just getting this error
rrors while parsing arguments:

While adding package streams:
error: no such package

Connect to Meteor Stream Externally

Hi, quick question

Is there any way to connect to a Meteor Stream like a normal websocket server using a websocket library? I'm trying to connect to Meteor Streams via an android app but, if I can't do this, I'll probably just implement a normal node.js websocket server instead.

Thanks,
Matthew

It does not work inside a method

var messaging = new Meteor.Stream('messaging');
Meteor.methods({
  "adLogin" : function(req){
    if( req.username && req.domain && req.password){
      var retval = adLogin(req.username, req.domain, req.password);
    } else {
      console.log('não recebi os parâmetros que preciso.', req);
      return false;
    }
    if (retval.success == true){
      return retval.result;
    }
    console.log(retval.result);
    messaging.emit('loginProcessFailed', retval.result);
    return false;
  }
});

The method always ends before the actions of "messaging" happen.
Why?

client2client, WRTC, p2p ?

Hi there Arunoda,

I started following your work recently and u are amazing guy with lot of good open source codes. Tnx.

I have question. Recently I started using meteor for my projects, and planning for long time to use some WRTC/p2p code to have no server side chat on my app.

Is this that kind of chat ? Where u done need server resources ? If yes, can that be live video chat between clients/users directly and not wasting server resources ?

Stefan
Peace,

Streaming Video Camera

Hi Arunoda

I have a requirement for streaming live video from my phone camera and/or attaching a photo to the blackboard.

Is this possible?

Many Thanks
Leon

onConnected hook

It would be nice if I can register on a stream to get notified after a client has established a connection to the server.

In my current project I need this to initialize a context object for each client on the server. Hence, I have to check in every listening (server) method if such a context is already available. In case not, a new context object is created.

Closing a stream on the server

Looks like there isn't a way yet to clean to terminate a stream on the server and release the underlying publications and methods.

Is there something planned for this?

emit not working - not emiting to all clients and Random is not defined.

Just in stalled Streams and added the standard example code (with correct permissions)

chatStream = new Meteor.Stream('chat');

sendChat = function(message) {
chatStream.emit('message', message);
console.log('me: ' + message);
};

chatStream.on('message', function(message, arg) {
console.log(arg);
console.log('user: ' + message);
});

I run into the following two errors:

  1. When I load my Meteor app for the first time I get the following exception:
    I20151005-11:50:11.732(1)? Exception from sub stream-chat id S6sjbJYZ3zn4wLr8f ReferenceError: Random is not defined
    I20151005-11:50:11.734(1)? at [object Object].handler (packages/streams/lib/server.js:40:1)
    I20151005-11:50:11.734(1)? at maybeAuditArgumentChecks (livedata_server.js:1692:12)
    I20151005-11:50:11.734(1)? at [object Object].
    .extend.runHandler (livedata_server.js:1023:17)
    I20151005-11:50:11.734(1)? at [object Object].
    .extend.startSubscription (livedata_server.js:842:9)
    I20151005-11:50:11.734(1)? at [object Object].
    .extend.protocol_handlers.sub (livedata_server.js:614:12)
    I20151005-11:50:11.734(1)? at livedata_server.js:548:43
    I20151005-11:50:13.321(1)? Exception from sub stream-chat id 7bv8NZNAp7pP9KT8G ReferenceError: Random is not defined
    I20151005-11:50:13.321(1)? at [object Object].handler (packages/streams/lib/server.js:40:1)
    I20151005-11:50:13.321(1)? at maybeAuditArgumentChecks (livedata_server.js:1692:12)
    I20151005-11:50:13.321(1)? at [object Object].
    .extend.runHandler (livedata_server.js:1023:17)
    I20151005-11:50:13.321(1)? at [object Object].
    .extend.startSubscription (livedata_server.js:842:9)
    I20151005-11:50:13.321(1)? at [object Object].
    .extend.protocol_handlers.sub (livedata_server.js:614:12)
    I20151005-11:50:13.322(1)? at livedata_server.js:548:43
  2. Events are not emitted to all clients, only the sender.

Documentation issue

On documentation page "Communication Patterns": first argument of the function is eventName not userId:

if(Meteor.isServer) {
stream.permissions.write(function(userId, eventName) {
return false;
});

stream.permissions.read(function(userId, eventName) {
return true;
});

Your app is crashing. Here's the latest log.

Homepage-Example: Your app is crashing. Here's the latest log.

/Applications/MAMP/htdocs/frequentis/ms-homepage/.meteor/local/build/server/server.js:337
}).run();
^
TypeError: undefined is not a function
at app/server-to-client.js:1:32
at /Applications/MAMP/htdocs/frequentis/ms-homepage/.meteor/local/build/server/server.js:298:12
at Array.forEach (native)
at Function..each..forEach (/Users/manfredspecht/.meteor/tools/cc18dfef9e/lib/node_modules/underscore/underscore.js:78:11)
at run (/Applications/MAMP/htdocs/frequentis/ms-homepage/.meteor/local/build/server/server.js:239:7)
=> Exited with code: 1
=> Your application is crashing. Waiting for file change.

Notifications between server events

I think it would be interesting to add the "emit - on" functionality even at server level.
Probably there are other packages that are doing that, but it is interesting to chain notifications with the meteor-streams without the need to install other packages.

Example:

eventStream = new Meteor.Stream('eventstream');

if(Meteor.isServer) {
  sendEvent = function(message) {
    eventStream .emit('eventName', message);
       console.log('event just triggered from server: ' + message);
  };

  eventStream .on('eventName', function(message) {
    console.log('subscriber function triggered : ' + message);
  });
}

Additional parameters is null in read permissions

Hi,

I have following code for chat application with channels:

stream.permissions.write(function(eventName, message, channelName) {
    var currentUser = Meteor.users.findOne({_id : this.userId});
    return _.contains(currentUser.channelsJoined, channelName) // if user joined chat - allow him to send chat stream message
}, false);
}

stream.permissions.read(function(eventName, message, channelName) {
    var currentUser = Meteor.users.findOne({_id : this.userId});
    return _.contains(currentUser.channelsJoined, channelName) // if user joined chat - allow him to receive chat stream message
}, false);
}

When I pass channel name in emit - write permissions sees it, however in read permissions code channelName argument is undefined. I didn't find much about this in documentation and it seems it should work like that. What I am doing wrong? Or is it a bug? Because permissions without additional parameters is pretty much useless in real world scenarios...

Feature

Hello again,
Is there a way to use this package for internal messaging between registred users ? Not as a live chat app , just exchanged messges 👍

Thanks!

Streams not working until page refreshed

I am using streams to send notification between two applications. The applications are communicating through clusters via redis. Whenever, I push some notification from one app to another, it does not work. But when I refresh the browsers and try, it works.

Can u please tell me what is the problem. My code goes as follows:

App 1 code
function sendMessage(message,date,toUserId,fromUserId,jobId){
ChatStream.emit(toUserId,message,date,toUserId,fromUserId,jobId);
}

ChatStream.on(Meteor.userId(),function(message,date,toUserId,fromUserId,jobId){
var formatDate = moment(date).fromNow();
var index = ClientChat.find().count();
var chatObj = {
from:fromUserId,
message:message,
date:formatDate,
jobId:jobId,
index:index
}
//ClientChat.insert({from:fromUserId,message:message,date:formatDate,jobId:jobId,index:index})
ClientChat.insert(chatObj);
Session.set('receivedPing',chatObj);
})

App2
function sendMessage(message,date,toUserId,fromUserId,jobId){
ChatStream.emit(toUserId,message,date,toUserId,fromUserId,jobId);
}

ChatStream.on(Meteor.userId(),function(message,date,toUserId,fromUserId,jobId){
ClientChat.insert({from:fromUserId,message:message,date:date,jobId:jobId})
})

Cluster.js in server folder
Meteor.startup(function(){
Meteor.Cluster.init();
Meteor.Cluster.sync(ChatStream,LocalNotificationStream);
})

lib folder
ChatStream = new Meteor.Stream('chatStream');

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.