Giter Site home page Giter Site logo

angular-live-set's Introduction

slc -- StrongLoop Controller

Note: The slc wrapper has been deprecated. slc bundled together a set of features that are still available through use of the following packages:

slc is the command shell for the StrongLoop Process Manager, strong-pm, and the LoopBack framework.

It includes both a CLI and a GUI.

For more details, see http://strong-pm.io and http://loopback.io.

Installation

It can be installed with:

npm install -g strongloop

Resources

Usage

usage: slc <-h|--help|-v|--version>
usage: slc <command> [--help] [...]

Command-line tool for development and control of a Node application.

Options:
  -h,--help     Print usage for slc, or for an slc command, and exit.
  -v,--version  Print versions of slc and its dependencies, and exit.

Commands:

  arc: StrongLoop GUI, an alternative to the CLI

    Launch the StrongLoop GUI, a graphical alternative to the `loopback`,
    `build`, `deploy`, and `pmctl` commands, that also offers run-time
    profiling and debugging.

  loopback: LoopBack application scaffolder

    Create LoopBack 2.x applications, datasources, models, ACLs, and relations.

  debug: Node.js application debugger

  start: start a node application under a local process manager

    Start a local process manager, if necessary, and run the application
    in-place.

  build: package a node application for deployment

    Packages a node application as an npm tarball or into a git deploy branch.
    Deploy the package using the `deploy` command, or your existing DevOps
    pipeline.

  deploy: deploy a node application package

    Deploy an application to the StrongLoop process manager (see `pm-install`
    command), or to any PaaS that can accept a `git push` of a node
    application.

  ctl: control a node application hosted by the process manager

    Run-time remote control of clustering, profiling, logging, restart, etc.
    See the `pm-install` and `pm` commands.

  pm-install: install the StrongLoop process manager

    The process manager hosts applications, allowing them to be deployed,
    re-deployed, controlled, and monitored, and for application metrics and
    logs to be viewed in Arc and published to thirdparty services (Splunk,
    Datadog, Statsd, etc.). To experiment locally with the manager without
    installing, see the `pm` command.


These commands are used internally, and may be useful when building custom
tooling and integrations with StrongLoop features:

  pm: run the StrongLoop process manager

    Normally, the process manager is installed as a system service (upstart or
    systemd) and run by the system, but it can be run directly for
    experimentation, or to build custom DevOps deployment tooling.

  run: supervise a node application

    The StrongLoop kernel, the supervisor extends a node application with
    node clustering, profiling, metrics collection and delivery, dynamic
    profiling, logging, etc. Normally, its used by the process manager, but
    it can be run directly for experimentation, or to build custom DevOps
    deployment tooling.

  runctl: control a node application hosted by the supervisor

    Useful when using the `run` command directly.

  registry: npm registry manipulation

    Switch between npm registries and promote packages between them. Useful
    as a component of DevOps/CI pipelines, or from the command line.

License

strongloop uses a dual license model.

You may use this library under the terms of the Artistic 2.0 license, or under the terms of the StrongLoop Subscription Agreement.

angular-live-set's People

Contributors

0candy avatar bajtos avatar crandmck avatar davidcheung avatar dhmlau avatar nabdelgadir avatar ritch avatar rmg avatar sam-github avatar siddhipai 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-live-set's Issues

What's the best practice for monitoring a filtered stream?

I need to stream changes to a specified user, not to all users.

In my below code I can successfully initially query messages for a specific user, but any updates to the stream is not filtered. So it gives me updates to any change to the Message model regardless of the filter.

  1. Is there a way to filter a subset of a stream? Most specifically the authenticated user?
  2. I have a belongsTo relation between my Message model and my user model (which has User as the base model). Can I monitor a stream specific to user.Message, i.e. to just the relation?

Here's my current code:

   var url = '/api/messages/change-stream' +
      '?_format=event-source' +
      '&access_token=' + AuthService.getAccessToken();

    var src = new EventSource(url);
    var changes = createChangeStream(src);
    var set;

    Message.find({
      filter: {
        where: {
          userId: '55f73db4b3a03aa495c0aef2'
        },
        order: 'created DESC',
        limit: 5
      }
    }).$promise.then(function(results) {
      set = new LiveSet(results, changes);
      vm.messages = set.toLiveArray();
    });

I can see here that you can set a where clause in creating a change-stream: https://apidocs.strongloop.com/loopback/#persistedmodel-createchangestream, but I'm struggling on how to do this with the LiveSet approach. I suspect somehow from the Angular client I can create a change stream, pass in an option 'where clause'.

I'm also struggling to understand how the lbServices createChangeStream factors into all of this, like Message.createChangeStream(), versus the newly released factory createChangeStream() that's in angular-live-set.

CI failure

Below are the failure. See #34 for the error messages.

[cis-jenkins] PR Builder Build finished.
[cis-jenkins] x64 && linux && nvm,0.10 Failed! (af6cebf)
[cis-jenkins] x64 && linux && nvm,0.12 Failed! (af6cebf)
[cis-jenkins] x64 && linux && nvm,8 Failed! (af6cebf)
angular-live-set Failed! (af6cebf)
angular-live-set/node=0.10,os=amazon Failed! (af6cebf)
angular-live-set/node=0.10,os=macos Failed! (af6cebf)
angular-live-set/node=0.10,os=ubuntu Failed! (af6cebf)
angular-live-set/node=0.10,os=windows Failed! (af6cebf)
angular-live-set/node=0.12,os=amazon Failed! (af6cebf)
angular-live-set/node=0.12,os=macos Failed! (af6cebf)
angular-live-set/node=0.12,os=ubuntu Failed! (af6cebf)
angular-live-set/node=0.12,os=windows Failed! (af6cebf)
angular-live-set/node=4.x,os=windows Failed! (af6cebf)
angular-live-set/node=6.x,os=macos Failed! (af6cebf)
angular-live-set/node=6.x,os=ubuntu Failed! (af6cebf)
angular-live-set/node=6.x,os=windows Failed! (af6cebf)

Internet Explorer Comptability Solved

I solved Internet Explorer compatibility early on when I was using this and thought to document it here.

There is a polyfill that you can get on bower that solves it. From my bower.json

"event-source-polyfill": "^0.0.7"

The magic of LiveSet stop whenever I call the method twice !!!

Hi,

I tried to use the google groups to solve my issue but I didn't have any helpful answer.,, it is simply the LiveSet not updated even that the events is received... this odd behaviour start when I call the following code twice

set=new LiveSet(result,changes)
$scope.list=set.toLiveArray()

the $scope.list in the second call is updated with the new result, however, the $scope.list not notified whenever new event occur...

https://groups.google.com/forum/#!searchin/loopbackjs/liveset/loopbackjs/NrtbSZwWiQo/RYcod9N9AwAJ

I really appreciate any kind of help,

Thanks in advance

Docs contain the wrong file name

Description/Steps to reproduce

Install angular-live-set as mentioned in docs.

Link to reproduction sandbox

Expected result

The readme doc says to add following script file in application:

<script type="text/javascript" src="bower_components/angular-live-set/angular-live-set.js"></script>

But this file is not available.
The file path should be changed to

<script type="text/javascript" src="bower_components/angular-live-set/dist/live-set.js"></script>

Additional information

darwin x64 6.9.5

├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] -> /Users/kamal/dev/loopback-reset-password-mixin

Does not work with non-integer ids

It seems like this plugin does not work whenever the ID of an object is not an integer. Looked into the code and it seems like it's trying to create an numbered 1d array (not an object). All fine but I'm using uuid4s to identify my objects.

Whenever an object is updated the values all disappear and the whole object is replaced by just the updated key.

PATCH / updates to attributes not caught in LiveArrays

I have a var set = new LiveSet(data, changes) instantiated, where changes is from createChangeStream for a loopback change-stream.

I'm manually patching through the REST API, and I get the updated object in my change-stream url, as well as a proper log from changes.on('data', function(event){ console.log(data); })

But my bound $scope.data = set.toLiveArray();'s data does not reflect on my scope. The $scope.data values are still the old ones.

'stream is not defined' when loaded as npm module

I'm wondering if this has to do with the AMD modules in the dist?

``new stream.PassThrough` is what throws this on line 19, though I can see that Stream.PassThrough is defined later on.

I'm running Angular with Babel and ES6 in an electron.js runtime, in the renderer context, so bascially a chromium browser. Maybe I should try loading directly from the modules/ directory?

Optimistic create

I'd like to start a conversation about implementing optimistic create. The feature is very important for building a responsive application. The issue with implementing this feature is that its without a target there is no way of knowing that data that a create event in the EventStream corresponds with an item that was added optimistically.

A couple of thoughts:

  • Perhaps the strongloop change stream implementation should not echo the changes back to the client that made them. The client already gets the server response via the HTTP request and can update the optimistically created resource on the HTTP response.
  • If the client were able to reserve an ID then we could associate created items from EventStream with items optimistically created on the client. It seems like strongloop's synchronization efforts do something similar where they use a guid as the primary key.

_format=event-source ?

Hi there,
i try to understand the backend side. I didnt find any doc or code about _format=event-source ?
Where is the implementation in loopback?

Thanks

Error when testing change stream

Web server listening at: http://0.0.0.0:3000/
Error: Can't set headers after they are sent.
at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:335:11)
at ServerResponse.res.setHeader (/Users/stellanhaglund/Documents/oopy/node_modules/loopback-explorer/node_modules/express/node_modules/connect/lib/patch.js:134:22)
at ServerResponse.header (node_modules/loopback/node_modules/express/lib/response.js:718:10)
at ServerResponse.send (node_modules/loopback/node_modules/express/lib/response.js:163:12)
at ServerResponse.json (node_modules/loopback/node_modules/express/lib/response.js:249:15)
at ServerResponse.send (node_modules/loopback/node_modules/express/lib/response.js:151:21)
at defaultHandler (node_modules/loopback/node_modules/strong-remoting/lib/rest-adapter.js:380:11)
at restErrorHandler (node_modules/loopback/node_modules/strong-remoting/lib/rest-adapter.js:347:14)
at Layer.handle_error (node_modules/loopback/node_modules/express/lib/router/layer.js:71:5)
at trim_prefix (node_modules/loopback/node_modules/express/lib/router/index.js:310:13)

Is it working on Ionic? Mine is not

Is this live-set module working on ionic? because mine is not working.
and i don't get any error.

here is my code:

on Main App

angular.module('starter', ['ionic', 'starter.controllers', 'lbServices', 'ls.LiveSet', 'ls.ChangeStream'])
//etc............

on Controller

angular.module('starter.controllers', [])
.controller('ProductsCtrl', function($scope, $ionicModal, Product, createChangeStream, LiveSet) {
            var src = new EventSource('http://localhost:3000/api/products/change-stream?_format=event-source');
            var changes = createChangeStream(src);
            var set;

            Product.find().$promise.then(function(results) {
                set = new LiveSet(results, changes);
                $scope.products = set.toLiveArray();
            });

            changes.on('data', function(update) {
                // add the new data to the chart
                console.log('something happened')
                console.log(update)
            });
//etc.................

My data is shown like expected, but the realtime thing is not working.
Please help

Limit and Skip, how to use LiveSet with paging?

Hi All,

I can't understand how to use LiveSet with limit and skip?

Actually, exactly like Facebook, notifications dropdown .. which is realtime notifications + paging

Any ideas?

Thanks.

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.