Skip to content

Commit

Permalink
Merge pull request #33 from VigneshVSV/main
Browse files Browse the repository at this point in the history
2 line minor bug fix for IPC
  • Loading branch information
VigneshVSV authored Aug 12, 2024
2 parents 344199f + 811dbab commit f45c8b8
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 13 deletions.
13 changes: 10 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Security
- cookie auth & its specification in TD
✓ means ready to try

- cookie auth & its specification in TD (cookie auth branch)
- image event handlers (develop branch) for streaming live video as JPEG and PNG ✓
- pydantic support for property models (develop branch) ✓

## [v0.2.3] - 2024-08-11

- HTTP SSE minor bug-fix/optimization - no difference to the user

## [v0.2.2] - 2024-08-09

- thing control panel works better with the server side and support observable properties
- `ObjectProxy` client API has been improved to resemble WoT operations better, for examplem `get_property` is now
- `ObjectProxy` client API has been improved to resemble WoT operations better, for example `get_property` is now
called `read_property`, `set_properties` is now called `write_multiple_properties`.
- `ObjectProxy` client reliability for poorly written server side actions improved

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

### Description

`hololinked` is a server side pythonic tool suited for instrumentation control and data acquisition over network, especially with HTTP. If you have a requirement to control and capture data from your hardware/instrumentation, show the data in a browser/dashboard, provide a GUI or run automated scripts, `hololinked` can help. Even for isolated applications or a small lab setup without networking concepts, one can still separate the concerns of the tools that interact with the hardware & the hardware itself.
`hololinked` is a beginner-friendly server side pythonic tool suited for instrumentation control and data acquisition over network, especially with HTTP. If you have a requirement to control and capture data from your hardware/instrumentation, show the data in a browser/dashboard, provide a GUI or run automated scripts, `hololinked` can help. Even for isolated applications or a small lab setup without networking concepts, one can still separate the concerns of the tools that interact with the hardware & the hardware itself.

[![Documentation Status](https://readthedocs.org/projects/hololinked/badge/?version=latest)](https://hololinked.readthedocs.io/en/latest/?badge=latest) [![PyPI](https://img.shields.io/pypi/v/hololinked?label=pypi%20package)](https://pypi.org/project/hololinked/) [![PyPI - Downloads](https://img.shields.io/pypi/dm/hololinked)](https://pypistats.org/packages/hololinked) [![codecov](https://codecov.io/gh/VigneshVSV/hololinked/graph/badge.svg?token=JF1928KTFE)](https://codecov.io/gh/VigneshVSV/hololinked)
<br>
Expand Down
2 changes: 1 addition & 1 deletion doc
Submodule doc updated from a06486 to 84450d
2 changes: 1 addition & 1 deletion examples
2 changes: 1 addition & 1 deletion hololinked/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.2.2"
__version__ = "0.2.3"
6 changes: 3 additions & 3 deletions hololinked/server/HTTPServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ def __init__(self, things : typing.List[str], *, port : int = 8080, address : st
self._type = HTTPServerTypes.THING_SERVER
self._lost_things = dict() # see update_router_with_thing
self._zmq_protocol = ZMQ_PROTOCOLS.IPC
self._zmq_socket_context = None
self._zmq_event_context = None
self._zmq_inproc_socket_context = None
self._zmq_inproc_event_context = None

@property
def all_ok(self) -> bool:
Expand All @@ -156,7 +156,7 @@ def all_ok(self) -> bool:
self.zmq_client_pool = MessageMappedZMQClientPool(self.things, identity=self._IP,
deserialize_server_messages=False, handshake=False,
http_serializer=self.serializer,
context=self._zmq_socket_context,
context=self._zmq_inproc_socket_context,
protocol=self._zmq_protocol,
logger=self.logger
)
Expand Down
4 changes: 2 additions & 2 deletions hololinked/server/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ async def handle_datastream(self) -> None:
called by GET method and handles the event.
"""
try:
event_consumer_cls = EventConsumer if hasattr(self.owner, '_zmq_event_context') else AsyncEventConsumer
event_consumer_cls = EventConsumer if self.owner._zmq_inproc_event_context else AsyncEventConsumer
# synchronous context with INPROC pub or asynchronous context with IPC or TCP pub, we handle both in async
# fashion as HTTP server should be running purely sync(or normal) python method.
event_consumer = event_consumer_cls(self.resource.unique_identifier, self.resource.socket_address,
Expand Down Expand Up @@ -301,7 +301,7 @@ async def handle_datastream(self) -> None:
self.write(data_header % self.serializer.dumps(
{"exception" : format_exception_as_json(ex)}))
try:
if isinstance(self.owner._zmq_event_context, zmq.asyncio.Context):
if isinstance(self.owner._zmq_inproc_event_context, zmq.asyncio.Context):
event_consumer.exit()
except Exception as ex:
self.logger.error(f"error while closing event consumer - {str(ex)}" )
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setuptools.setup(
name="hololinked",
version="0.2.2",
version="0.2.3",
author="Vigneh Vaidyanathan",
author_email="vignesh.vaidyanathan@hololinked.dev",
description="A ZMQ-based Object Oriented RPC tool-kit with HTTP support for instrument control/data acquisition or controlling generic python objects.",
Expand Down

0 comments on commit f45c8b8

Please sign in to comment.