Metadata-Version: 2.1
Name: mrworkserver
Version: 0.11
Summary: A python work server written in C
Home-page: http://github.com/MarkReedZ/mrworkserver/
Author: Mark Reed
Author-email: markreed99@gmail.com
License: MIT
Keywords: web,asyncio
Platform: x86_64 Linux and MacOS X
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: Environment :: Web Environment
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: C
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Internet :: WWW/HTTP
Description-Content-Type: text/markdown
License-File: LICENSE

# MrWorkServer
A simple clustered python 3.5+ asyncio based work server that uses the MrQ interface.

# Example

```python

import asyncio
import mrworkserver

async def callback(msgs):
  print("Callback:")
  for m in msgs:
    print(m)

ws = mrworkserver.WorkServer()
ws.cb = callback
ws.run()


```

# Example client

```python

# pip install asyncmrq mrjson

import asyncio
from mrq.client import Client
import mrjson

async def run(loop):
  c = Client()
  await c.connect(io_loop=loop,servers=[("127.0.0.1",7100)])

  msg = mrjson.dumpb([1,2,3,4,5,6,7,8,9,10])
  for x in range(10):
    await c.push( 0, 0, msg, len(msg) )

  await asyncio.sleep(1)
  await c.close()

if __name__ == '__main__':
  loop = asyncio.get_event_loop()
  loop.run_until_complete(run(loop))
  loop.close()

```




