websocket storage for Batman created!

105 views
Skip to first unread message

Anton Kulaga

unread,
Mar 18, 2013, 10:00:52 PM3/18/13
to batm...@googlegroups.com
Hi all,

I just want to report that I managed to create a websocket storage for Batman. 
It is on early stage but already works fine with both mock websockets and real websockets (with real websockets tested only in Chrome).

I made a small demo using mock class that emulates websockets and generates fake input here http://denigma.github.com/semantictasks/chatdemo.html
I have also a demo with real websockets (chat application with Scala Play as backend, although every backend may be used) but I need to prepare it for publishing (I am rather busy now, so I doubt that have time to do it this week)

Sources of demo together with socket storage (look inside collab folder) and some tests (test folder) are here  https://github.com/denigma/semantictasks

What has already been done:

1) Socket wrapper class that uses Websockets (or MockSocket for testing) underneath and does a some work with multiplexing, routing etc.
2) SocketEvent class for socket events with helpers
3) Channel class. As it is wise to use only one websocket connection for each user I implemented so called multiplexing ( http://en.wikipedia.org/wiki/Multiplexing ) where you can create a lot of logical channels from one socket and use them to exchange info with models.
4) Routing class (just started) that is used to route messages between various logical Channels.
5) MockSocket class for testing and some tests (look at test folder)
6) Socket storage itself that supports all basic operations (read, create,save, read) as well as push notifications (when servers push info to client) that are specific for websockets.  In the same time they are not well tested (there are tests in test folder as well as MockData in demo projects) and I do not like how I connected it to Batman's model ###I did it in a bit 'dirty way' as I had to figure out myself how Batman internal classes work. They are not well documented and Batmans google group is inactive, for some questions you may wait for a response for ages :(( ###
7) Demo application itself

In the same time the code is on early stage (so bugs happen), a lot of work should be done with testing, bugfixing and documentation before I will make a pull request to batman repo.

Maedi

unread,
Apr 21, 2013, 12:22:34 AM4/21/13
to batm...@googlegroups.com
Cool! Need to get my head around it all though :)

Anton Kulaga

unread,
Apr 21, 2013, 6:29:06 AM4/21/13
to batm...@googlegroups.com
>Cool! Need to get my head around it all though :)

The repo under the link that I gave here is constantly changing and improving. So it is quite possible that the demo there may become broken from time to time (I am trying to run tests before commiting but I have only a small part of the code covered with them) so do not hesitate to contact personaly when you start to look at the code.
By the way, now I also have videochats support there.


2013/4/21 Maedi <ma...@sourdough.com>
--
You received this message because you are subscribed to the Google Groups "batman.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to batmanjs+u...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Best regards,
Anton Kulaga

Tony Brown

unread,
Apr 21, 2013, 9:21:50 AM4/21/13
to batm...@googlegroups.com
I can't seem to get it to build? I'm using latest versions of everything, should I not be?

Tony Brown

unread,
Apr 21, 2013, 9:24:19 AM4/21/13
to batm...@googlegroups.com
can't seem to sign into the demo, is there a username and password?
This looks very promising though, keep us posted :)

Anton Kulaga

unread,
Apr 21, 2013, 10:08:53 PM4/21/13
to batm...@googlegroups.com
Did you use firefox to open it? If so, try chrome.
In latest commits I was experimenting with shared webworkers. Shared webworkers are js files that work in the background and can be shared by several tabs of the browser, so you can open a websocket connection inside a webworker and share it with several tabs.  Unfortunately firefox and chrome treat them differently so there are errors when you open it inside a firefox. There were also some commits from my colleagues that I did not check for bugs yet. Meanwhile you can switch off webworkers at all by commenting webworkers url inside conf.coffee

2013/4/21 Tony Brown <tonyb...@stu.aii.edu>

Tony Brown

unread,
Apr 21, 2013, 10:34:11 PM4/21/13
to batm...@googlegroups.com
I'm using canary and the normal chrome, gave up FF years ago

Anton Kulaga

unread,
Apr 21, 2013, 11:51:55 PM4/21/13
to batm...@googlegroups.com
Strange, in this case any username and password should work in the demo. Do you see any errors there? I definitely should check it myself in the nearest days


2013/4/22 Tony Brown <tonyb...@stu.aii.edu>

Anton Kulaga

unread,
May 9, 2013, 3:59:00 PM5/9/13
to batm...@googlegroups.com
Hey, Tony

I deployed a sample with websockets http://ec2-176-34-215-77.eu-west-1.compute.amazonaws.com where I connected my websocket storage to playframework 2 backend (scala). It is only a test app to test if it works well. It does not store any info . You will be asked to login there but you can type whatever you want as your login/password

Maedi

unread,
Jun 11, 2013, 5:30:31 AM6/11/13
to batm...@googlegroups.com
Any news? Is this stable? Will it be incorporated with Batman core?


On Tuesday, 19 March 2013 13:00:52 UTC+11, Anton Kulaga wrote:

Anton Kulaga

unread,
Jun 11, 2013, 8:17:24 AM6/11/13
to batm...@googlegroups.com
Hi,

You can test it here http://webintelligence.eu:9000/ (username and password can be arbitrary there, warning: it is my dev AMI instance so it is not always accessible, sometimes I reboot it)
I have not used it in production yet but in tests it works pretty well. The source code is https://github.com/denigma/semantictasks
And for the backend I use Scala Play + Akka (backend sources are there https://github.com/denigma/gene-actors , but any websocket backend can be used so you may not pay attention to them) There is also some code related WebRTC (p2p videochats) support there but I have not completed videopart yet.

> Will it be incorporated with Batman core?

Well, I would not mind doing it (although it would take some effort as I will need to rewrite my tests from mocha+chai to qunit that is used in Batman)  but I see no interest from Batman's team and community in it. So probably I will continue developing it on my own as I need it for several projects and only if there will be some interest I will try to integrate to Batman's core.


2013/6/11 Maedi <ma...@sourdough.com>
--
You received this message because you are subscribed to the Google Groups "batman.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to batmanjs+u...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

Tony Brown

unread,
Jun 11, 2013, 9:16:34 AM6/11/13
to batm...@googlegroups.com
that's great news, I'm going to fork it and take a look :)

Tony Brown

unread,
Jun 11, 2013, 9:19:36 AM6/11/13
to batm...@googlegroups.com
works now! that's awesome
Reply all
Reply to author
Forward
0 new messages