Code Monkey home page Code Monkey logo

primus-objc's People

Contributors

katopz avatar naartjie avatar nunofgs avatar pborreli avatar readmecritic avatar ruimarinho avatar trshafer 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

Watchers

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

primus-objc's Issues

Mistake

I read in docs:
"The minimum amount of time that Apple allows for background tasks is 10 minutes, which means that you must configure your server-side Primus with a timeout of at least 10 minutes."
I think it should be "The maximum amount of time that Apple allows for background tasks is 10 minutes"

No transformer specified.

First of all, thank you for making this awesome library.
I copy your sample code from objc and i was translate it to swift like this

let url: NSURL = NSURL(string: "http://localhost:8080/primus")!
let options: PrimusConnectOptions = PrimusConnectOptions()
let primus: Primus = Primus(URL: url, options: options)

When app is running, it's getting error like this
I have no idea what it is and how to resolve it

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'No transformer specified.'

Any help would be appreciated.

Thank you

How to target iOS?

Far as I know I just can't switch target to iOS and it just working.
So the question is anyone happen to have iOS target example?

Any hint is welcome. Thanks!

Main Thread

I wonder if there is a way to avoid any calls on main thread. Looks like this lib relies on Emitter library which calls callback on main thread. It's really bad to process any network operation and their callbacks on main thread...

Why is the incoming data transformation done so synchronously?

I can't seem to find this snippet's (Line 161 on Primus.m) equivalent in the javascript client. It's greatly written and works extremely well. You know more than I do but I have a few questions.

for (PrimusTransformCallback transform in self.transformers.incoming) {
        NSMutableDictionary *packet = [@{ @"data": data } mutableCopy];

        if (NO == transform(packet)) {
                // When false is returned by an incoming transformer it means that's
                // being handled by the transformer and we should not emit the `data`
                // event.
            return;
        }

        data = packet[@"data"];
   }
  • If there are several transformers, shouldn't this be asynchronously chained with a "then"-style call?
  • What's the design advantage of having Primus Instance to Transformers be a 1 - n relationship? The server side looks like it only accepts 1 transformer per primus instance. If so, could this be drastically cleaned up?

Help shed some light!

As always. Great library and excellent work.

Are there any Primus or Engine.io/Socket.io iOS/OSX Server implementations?

I figure the project owner of this project might have come across something. My cursory look didn't find anything promising. Did find websocket servers, but was hoping for the ability to have a socket.io or primus uniformly across my web app, server, and desktop/mobile app.

My project involves desktop browser page to phone communication. That's the only place I'm lacking the ability for the webpage to communicate with the phone in a similar way than the other cases.

Error: /bin/bash: node: command not found

While I try to run testing I got 14 failed with this clues.

Test Case '-[SocketIOClientSpec spt_runExampleAtIndex:]' started.
2015-05-13 12:46:51.156 xctest[7464:696938] Error: /bin/bash: node: command not found
/Users/pirsquare/git/primus-objc/PrimusTests/Transformers/socket.IO/

And yes, I'm running and using node without any problem via my Mac terminal.

$ which node
/usr/local/bin/node
$ node -v
v0.12.2

I think I miss something here(noob alert), any help would be appreciated, I'm stuck for an hour already.

Thanks

PrimusConnectOptions Documentation

I understand most of this class, but I cannot tell how the different options effect my app.

My Goal:
I would like my Primus instance to only reconnect when I tell it too. It seems to be infinitely doing this. What should I modify/change to make it stop this?

Thanks!

Using with Swift

Here is the short sample:

https://gist.github.com/cfr/dfcb50accd64014a0019

Obviously we need some kind of wrapper to avoid casting:

    let data: @objc_block (NSDictionary, AnyObject) -> () = { (d: NSDictionary, raw: AnyObject) -> () in
        NSLog("Got data: \(d)")
    }
    p.on("data" as AnyObject!, listener: unsafeBitCast(data, AnyObject.self))

Primus to Socket.io

Can i use this primus client library to connect to socket.io server. I want to connect socket.io version 1+ using this primus library. Is it ok ??

swift and ios background

I'm testing swift at the moment, and therefore I can't use your code :(
(or maybe I can, but don't know how haha)

That's why i'm using https://github.com/daltoniam/Starscream/blob/master/examples/SimpleTest/SimpleTest/ViewController.swift
and a nodejs primus server with faye.

Everything is working, except for one thing.
Keeping the connection open when the app is on the background (the user is at the home screen)

I want to keep it open, so I can send a notification or something else to it.
Do you have the same problem ?
Or can you send messages to it, when the app is in the background ?

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.