ipc-framework 1.0.0__tar.gz → 1.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. ipc_framework-1.1.0/PKG-INFO +273 -0
  2. ipc_framework-1.1.0/README.md +228 -0
  3. {ipc_framework-1.0.0 → ipc_framework-1.1.0}/ipc_framework/client.py +278 -273
  4. {ipc_framework-1.0.0 → ipc_framework-1.1.0}/ipc_framework/core.py +364 -352
  5. ipc_framework-1.1.0/ipc_framework.egg-info/PKG-INFO +273 -0
  6. {ipc_framework-1.0.0 → ipc_framework-1.1.0}/pyproject.toml +92 -92
  7. {ipc_framework-1.0.0 → ipc_framework-1.1.0}/setup.py +45 -45
  8. ipc_framework-1.0.0/PKG-INFO +0 -512
  9. ipc_framework-1.0.0/README.md +0 -467
  10. ipc_framework-1.0.0/ipc_framework.egg-info/PKG-INFO +0 -512
  11. {ipc_framework-1.0.0 → ipc_framework-1.1.0}/LICENSE +0 -0
  12. {ipc_framework-1.0.0 → ipc_framework-1.1.0}/MANIFEST.in +0 -0
  13. {ipc_framework-1.0.0 → ipc_framework-1.1.0}/examples/__init__.py +0 -0
  14. {ipc_framework-1.0.0 → ipc_framework-1.1.0}/examples/basic_server.py +0 -0
  15. {ipc_framework-1.0.0 → ipc_framework-1.1.0}/examples/chat_client.py +0 -0
  16. {ipc_framework-1.0.0 → ipc_framework-1.1.0}/examples/file_client.py +0 -0
  17. {ipc_framework-1.0.0 → ipc_framework-1.1.0}/examples/monitoring_client.py +0 -0
  18. {ipc_framework-1.0.0 → ipc_framework-1.1.0}/ipc_framework/__init__.py +0 -0
  19. {ipc_framework-1.0.0 → ipc_framework-1.1.0}/ipc_framework/demo.py +0 -0
  20. {ipc_framework-1.0.0 → ipc_framework-1.1.0}/ipc_framework/examples/__init__.py +0 -0
  21. {ipc_framework-1.0.0 → ipc_framework-1.1.0}/ipc_framework/examples/basic_server.py +0 -0
  22. {ipc_framework-1.0.0 → ipc_framework-1.1.0}/ipc_framework/examples/chat_client.py +0 -0
  23. {ipc_framework-1.0.0 → ipc_framework-1.1.0}/ipc_framework/examples/file_client.py +0 -0
  24. {ipc_framework-1.0.0 → ipc_framework-1.1.0}/ipc_framework/examples/monitoring_client.py +0 -0
  25. {ipc_framework-1.0.0 → ipc_framework-1.1.0}/ipc_framework/exceptions.py +0 -0
  26. {ipc_framework-1.0.0 → ipc_framework-1.1.0}/ipc_framework/py.typed +0 -0
  27. {ipc_framework-1.0.0 → ipc_framework-1.1.0}/ipc_framework/server.py +0 -0
  28. {ipc_framework-1.0.0 → ipc_framework-1.1.0}/ipc_framework.egg-info/SOURCES.txt +0 -0
  29. {ipc_framework-1.0.0 → ipc_framework-1.1.0}/ipc_framework.egg-info/dependency_links.txt +0 -0
  30. {ipc_framework-1.0.0 → ipc_framework-1.1.0}/ipc_framework.egg-info/entry_points.txt +0 -0
  31. {ipc_framework-1.0.0 → ipc_framework-1.1.0}/ipc_framework.egg-info/not-zip-safe +0 -0
  32. {ipc_framework-1.0.0 → ipc_framework-1.1.0}/ipc_framework.egg-info/requires.txt +0 -0
  33. {ipc_framework-1.0.0 → ipc_framework-1.1.0}/ipc_framework.egg-info/top_level.txt +0 -0
  34. {ipc_framework-1.0.0 → ipc_framework-1.1.0}/requirements.txt +0 -0
  35. {ipc_framework-1.0.0 → ipc_framework-1.1.0}/setup.cfg +0 -0
  36. {ipc_framework-1.0.0 → ipc_framework-1.1.0}/tests/test_basic.py +0 -0
@@ -0,0 +1,273 @@
1
+ Metadata-Version: 2.4
2
+ Name: ipc-framework
3
+ Version: 1.1.0
4
+ Summary: Efficient Inter-Process Communication Framework with hierarchical application and channel management
5
+ Home-page: https://github.com/ifesol/ipc-framework
6
+ Author: IPC Framework Team
7
+ Author-email: ifesol <ifesol@example.com>
8
+ Maintainer-email: ifesol <ifesol@example.com>
9
+ License: MIT
10
+ Project-URL: Homepage, https://github.com/ifesol/ipc-framework
11
+ Project-URL: Documentation, https://github.com/ifesol/ipc-framework#readme
12
+ Project-URL: Repository, https://github.com/ifesol/ipc-framework.git
13
+ Project-URL: Bug Tracker, https://github.com/ifesol/ipc-framework/issues
14
+ Keywords: ipc,communication,networking,client-server,messaging
15
+ Classifier: Development Status :: 4 - Beta
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
+ Classifier: Topic :: System :: Networking
19
+ Classifier: License :: OSI Approved :: MIT License
20
+ Classifier: Programming Language :: Python :: 3
21
+ Classifier: Programming Language :: Python :: 3.7
22
+ Classifier: Programming Language :: Python :: 3.8
23
+ Classifier: Programming Language :: Python :: 3.9
24
+ Classifier: Programming Language :: Python :: 3.10
25
+ Classifier: Programming Language :: Python :: 3.11
26
+ Classifier: Programming Language :: Python :: 3.12
27
+ Classifier: Operating System :: OS Independent
28
+ Requires-Python: >=3.7
29
+ Description-Content-Type: text/markdown
30
+ License-File: LICENSE
31
+ Provides-Extra: examples
32
+ Requires-Dist: psutil>=5.8.0; extra == "examples"
33
+ Provides-Extra: dev
34
+ Requires-Dist: pytest>=6.0.0; extra == "dev"
35
+ Requires-Dist: black>=21.0.0; extra == "dev"
36
+ Requires-Dist: flake8>=3.8.0; extra == "dev"
37
+ Requires-Dist: mypy>=0.910; extra == "dev"
38
+ Requires-Dist: isort>=5.0.0; extra == "dev"
39
+ Provides-Extra: all
40
+ Requires-Dist: ipc-framework[dev,examples]; extra == "all"
41
+ Dynamic: author
42
+ Dynamic: home-page
43
+ Dynamic: license-file
44
+ Dynamic: requires-python
45
+
46
+ # IPC Framework - Python Package
47
+
48
+ [![PyPI version](https://badge.fury.io/py/ipc-framework.svg)](https://pypi.org/project/ipc-framework/)
49
+ [![Python versions](https://img.shields.io/pypi/pyversions/ipc-framework.svg)](https://pypi.org/project/ipc-framework/)
50
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
51
+
52
+ **Efficient Inter-Process Communication Framework** with hierarchical application and channel management. Enables seamless **bidirectional communication** between Python servers and JavaScript/TypeScript clients.
53
+
54
+ ## 🚀 Key Features
55
+
56
+ - **🔄 Bidirectional Communication**: Full two-way messaging between Python ↔ JavaScript
57
+ - **🏗️ Hierarchical Organization**: Applications → Channels → Messages
58
+ - **📡 Multiple Patterns**: Request/Response, Pub/Sub, Notifications
59
+ - **🌍 Cross-Language**: Python server + JavaScript/TypeScript clients
60
+ - **⚡ High Performance**: WebSocket-based with optimized binary protocol
61
+ - **🛡️ Built-in Reliability**: Auto-reconnection, timeouts, error handling
62
+ - **📦 Zero Dependencies**: Pure Python implementation
63
+ - **🎯 Thread-Safe**: Safe for multi-threaded applications
64
+
65
+ ## ✨ What's New in v1.1.0
66
+
67
+ 🛠️ **Critical Bug Fixes**:
68
+ - ✅ **Fixed missing `create_response()` method** - Request/response now working
69
+ - ✅ **Fixed socket timeout deadlock** - Stable connections after handshake
70
+ - ✅ **Fixed threading deadlock** - Resolved receive/send blocking issue
71
+ - ✅ **Fully functional bidirectional communication** - Both directions working perfectly
72
+
73
+ ## 📦 Installation
74
+
75
+ ```bash
76
+ pip install ipc-framework
77
+ ```
78
+
79
+ ## 🎯 Quick Start
80
+
81
+ ### Python Server
82
+
83
+ ```python
84
+ from ipc_framework import FrameworkServer, MessageType
85
+ import time
86
+
87
+ # Create server
88
+ server = FrameworkServer(host="localhost", port=8888)
89
+
90
+ # Create application and channel
91
+ app = server.create_application("my_app", "My Application")
92
+ api_channel = app.create_channel("api")
93
+
94
+ # Handle requests
95
+ def handle_request(message):
96
+ if message.payload.get('action') == 'get_time':
97
+ # Use the working create_response() method!
98
+ response = message.create_response({
99
+ 'success': True,
100
+ 'time': time.time(),
101
+ 'message': 'Current server time'
102
+ })
103
+
104
+ connection = server.connection_manager.get_connection(
105
+ message.payload.get('connection_id')
106
+ )
107
+ server.send_to_connection(connection, response)
108
+
109
+ api_channel.set_handler(MessageType.REQUEST, handle_request)
110
+ server.start()
111
+ ```
112
+
113
+ ### Python Client
114
+
115
+ ```python
116
+ from ipc_framework import FrameworkClient
117
+
118
+ # Create and connect client
119
+ client = FrameworkClient("my_app", host="localhost", port=8888)
120
+ client.connect()
121
+
122
+ # Send request and get response
123
+ response = client.send_request("api", {
124
+ "action": "get_time",
125
+ "connection_id": client.connection_id
126
+ })
127
+
128
+ print(f"Server time: {response.payload['time']}")
129
+ client.disconnect()
130
+ ```
131
+
132
+ ### JavaScript Client (Works with Python Server!)
133
+
134
+ ```javascript
135
+ import { IPCClient } from '@ifesol/ipc-framework-js';
136
+
137
+ const client = new IPCClient('my_app', {
138
+ host: 'localhost',
139
+ port: 8888
140
+ });
141
+
142
+ await client.connect();
143
+
144
+ const response = await client.sendRequest('api', {
145
+ action: 'get_time',
146
+ connection_id: client.connectionId
147
+ });
148
+
149
+ console.log('Server time:', response.payload.time);
150
+ ```
151
+
152
+ ## 🔄 Communication Patterns
153
+
154
+ ### 1. Request/Response (Bidirectional)
155
+ ```python
156
+ # Client → Server → Client
157
+ response = client.send_request("api", {"action": "get_users"})
158
+ ```
159
+
160
+ ### 2. Pub/Sub Notifications (Server → Client)
161
+ ```python
162
+ # Server broadcasts to all subscribers
163
+ def notification_handler(message):
164
+ print(f"Notification: {message.payload}")
165
+
166
+ client.subscribe("notifications", notification_handler)
167
+ ```
168
+
169
+ ### 3. Real-time Updates (Both Directions)
170
+ ```python
171
+ # Client can trigger server notifications
172
+ client.request("api", {"action": "trigger_notification"})
173
+ # Server sends real-time updates to all clients
174
+ ```
175
+
176
+ ## 🌍 Cross-Language Architecture
177
+
178
+ ```
179
+ ┌─────────────────┐ WebSocket ┌──────────────────┐
180
+ │ Python Server │ ←──────────────→ │ JavaScript Client│
181
+ │ │ │ (Browser/Node) │
182
+ │ - Applications │ │ - TypeScript │
183
+ │ - Channels │ │ - React/Vue │
184
+ │ - Message Routing │ - Auto-reconnect│
185
+ └─────────────────┘ └──────────────────┘
186
+ ```
187
+
188
+ ## 📊 Performance & Reliability
189
+
190
+ | Feature | Status |
191
+ |---------|---------|
192
+ | **Bidirectional Messaging** | ✅ Working |
193
+ | **Connection Stability** | ✅ Fixed deadlocks |
194
+ | **Request/Response** | ✅ Working |
195
+ | **Pub/Sub** | ✅ Working |
196
+ | **Error Handling** | ✅ Built-in |
197
+ | **Thread Safety** | ✅ Fixed |
198
+ | **Auto-reconnection** | ✅ JS client |
199
+
200
+ ## 🛠️ Command Line Tools
201
+
202
+ The package includes several CLI tools for testing:
203
+
204
+ ```bash
205
+ # Start demo server
206
+ ipc-server
207
+
208
+ # Interactive chat client
209
+ ipc-chat your_username
210
+
211
+ # File sharing demo
212
+ ipc-file
213
+
214
+ # System monitoring
215
+ ipc-monitor
216
+
217
+ # Full framework demo
218
+ ipc-demo
219
+ ```
220
+
221
+ ## 🎯 Use Cases
222
+
223
+ ### Real-time Applications
224
+ - **Chat systems** with multiple channels
225
+ - **Live dashboards** with metric streaming
226
+ - **Collaborative editors** with real-time updates
227
+ - **Gaming** with real-time state sync
228
+
229
+ ### Web Applications
230
+ - **Python backend** ↔ **React frontend**
231
+ - **API servers** with real-time notifications
232
+ - **Microservice communication**
233
+ - **IoT device control**
234
+
235
+ ### Multi-Process Systems
236
+ - **Service-to-service** communication
237
+ - **Background task** coordination
238
+ - **Distributed processing**
239
+ - **Event-driven architectures**
240
+
241
+ ## 📚 Documentation
242
+
243
+ - **[Complete Documentation](./docs/README.md)** - Full guides and examples
244
+ - **[API Reference](./docs/api-reference.md)** - Detailed API documentation
245
+ - **[Integration Guide](./docs/integration-guide.md)** - Framework integration examples
246
+ - **[Examples](./docs/examples.md)** - Real-world usage examples
247
+
248
+ ## 🆚 Why Choose IPC Framework?
249
+
250
+ | Traditional IPC | IPC Framework |
251
+ |----------------|---------------|
252
+ | ❌ Complex setup | ✅ 3-line setup |
253
+ | ❌ Python-only | ✅ Python ↔ JavaScript |
254
+ | ❌ Manual protocols | ✅ Built-in patterns |
255
+ | ❌ No web support | ✅ Direct browser clients |
256
+ | ❌ External dependencies | ✅ Zero dependencies |
257
+
258
+ ## 🔗 Related Packages
259
+
260
+ - **JavaScript Client**: [@ifesol/ipc-framework-js](https://www.npmjs.com/package/@ifesol/ipc-framework-js)
261
+ - **NPM Package**: Full TypeScript support for Node.js and browsers
262
+
263
+ ## 📄 License
264
+
265
+ MIT License - see [LICENSE](LICENSE) file for details.
266
+
267
+ ## 🤝 Contributing
268
+
269
+ Contributions are welcome! Please feel free to submit issues and pull requests.
270
+
271
+ ---
272
+
273
+ **Ready for production use!** 🚀 The framework now provides reliable, bidirectional communication between Python servers and JavaScript clients.
@@ -0,0 +1,228 @@
1
+ # IPC Framework - Python Package
2
+
3
+ [![PyPI version](https://badge.fury.io/py/ipc-framework.svg)](https://pypi.org/project/ipc-framework/)
4
+ [![Python versions](https://img.shields.io/pypi/pyversions/ipc-framework.svg)](https://pypi.org/project/ipc-framework/)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+
7
+ **Efficient Inter-Process Communication Framework** with hierarchical application and channel management. Enables seamless **bidirectional communication** between Python servers and JavaScript/TypeScript clients.
8
+
9
+ ## 🚀 Key Features
10
+
11
+ - **🔄 Bidirectional Communication**: Full two-way messaging between Python ↔ JavaScript
12
+ - **🏗️ Hierarchical Organization**: Applications → Channels → Messages
13
+ - **📡 Multiple Patterns**: Request/Response, Pub/Sub, Notifications
14
+ - **🌍 Cross-Language**: Python server + JavaScript/TypeScript clients
15
+ - **⚡ High Performance**: WebSocket-based with optimized binary protocol
16
+ - **🛡️ Built-in Reliability**: Auto-reconnection, timeouts, error handling
17
+ - **📦 Zero Dependencies**: Pure Python implementation
18
+ - **🎯 Thread-Safe**: Safe for multi-threaded applications
19
+
20
+ ## ✨ What's New in v1.1.0
21
+
22
+ 🛠️ **Critical Bug Fixes**:
23
+ - ✅ **Fixed missing `create_response()` method** - Request/response now working
24
+ - ✅ **Fixed socket timeout deadlock** - Stable connections after handshake
25
+ - ✅ **Fixed threading deadlock** - Resolved receive/send blocking issue
26
+ - ✅ **Fully functional bidirectional communication** - Both directions working perfectly
27
+
28
+ ## 📦 Installation
29
+
30
+ ```bash
31
+ pip install ipc-framework
32
+ ```
33
+
34
+ ## 🎯 Quick Start
35
+
36
+ ### Python Server
37
+
38
+ ```python
39
+ from ipc_framework import FrameworkServer, MessageType
40
+ import time
41
+
42
+ # Create server
43
+ server = FrameworkServer(host="localhost", port=8888)
44
+
45
+ # Create application and channel
46
+ app = server.create_application("my_app", "My Application")
47
+ api_channel = app.create_channel("api")
48
+
49
+ # Handle requests
50
+ def handle_request(message):
51
+ if message.payload.get('action') == 'get_time':
52
+ # Use the working create_response() method!
53
+ response = message.create_response({
54
+ 'success': True,
55
+ 'time': time.time(),
56
+ 'message': 'Current server time'
57
+ })
58
+
59
+ connection = server.connection_manager.get_connection(
60
+ message.payload.get('connection_id')
61
+ )
62
+ server.send_to_connection(connection, response)
63
+
64
+ api_channel.set_handler(MessageType.REQUEST, handle_request)
65
+ server.start()
66
+ ```
67
+
68
+ ### Python Client
69
+
70
+ ```python
71
+ from ipc_framework import FrameworkClient
72
+
73
+ # Create and connect client
74
+ client = FrameworkClient("my_app", host="localhost", port=8888)
75
+ client.connect()
76
+
77
+ # Send request and get response
78
+ response = client.send_request("api", {
79
+ "action": "get_time",
80
+ "connection_id": client.connection_id
81
+ })
82
+
83
+ print(f"Server time: {response.payload['time']}")
84
+ client.disconnect()
85
+ ```
86
+
87
+ ### JavaScript Client (Works with Python Server!)
88
+
89
+ ```javascript
90
+ import { IPCClient } from '@ifesol/ipc-framework-js';
91
+
92
+ const client = new IPCClient('my_app', {
93
+ host: 'localhost',
94
+ port: 8888
95
+ });
96
+
97
+ await client.connect();
98
+
99
+ const response = await client.sendRequest('api', {
100
+ action: 'get_time',
101
+ connection_id: client.connectionId
102
+ });
103
+
104
+ console.log('Server time:', response.payload.time);
105
+ ```
106
+
107
+ ## 🔄 Communication Patterns
108
+
109
+ ### 1. Request/Response (Bidirectional)
110
+ ```python
111
+ # Client → Server → Client
112
+ response = client.send_request("api", {"action": "get_users"})
113
+ ```
114
+
115
+ ### 2. Pub/Sub Notifications (Server → Client)
116
+ ```python
117
+ # Server broadcasts to all subscribers
118
+ def notification_handler(message):
119
+ print(f"Notification: {message.payload}")
120
+
121
+ client.subscribe("notifications", notification_handler)
122
+ ```
123
+
124
+ ### 3. Real-time Updates (Both Directions)
125
+ ```python
126
+ # Client can trigger server notifications
127
+ client.request("api", {"action": "trigger_notification"})
128
+ # Server sends real-time updates to all clients
129
+ ```
130
+
131
+ ## 🌍 Cross-Language Architecture
132
+
133
+ ```
134
+ ┌─────────────────┐ WebSocket ┌──────────────────┐
135
+ │ Python Server │ ←──────────────→ │ JavaScript Client│
136
+ │ │ │ (Browser/Node) │
137
+ │ - Applications │ │ - TypeScript │
138
+ │ - Channels │ │ - React/Vue │
139
+ │ - Message Routing │ - Auto-reconnect│
140
+ └─────────────────┘ └──────────────────┘
141
+ ```
142
+
143
+ ## 📊 Performance & Reliability
144
+
145
+ | Feature | Status |
146
+ |---------|---------|
147
+ | **Bidirectional Messaging** | ✅ Working |
148
+ | **Connection Stability** | ✅ Fixed deadlocks |
149
+ | **Request/Response** | ✅ Working |
150
+ | **Pub/Sub** | ✅ Working |
151
+ | **Error Handling** | ✅ Built-in |
152
+ | **Thread Safety** | ✅ Fixed |
153
+ | **Auto-reconnection** | ✅ JS client |
154
+
155
+ ## 🛠️ Command Line Tools
156
+
157
+ The package includes several CLI tools for testing:
158
+
159
+ ```bash
160
+ # Start demo server
161
+ ipc-server
162
+
163
+ # Interactive chat client
164
+ ipc-chat your_username
165
+
166
+ # File sharing demo
167
+ ipc-file
168
+
169
+ # System monitoring
170
+ ipc-monitor
171
+
172
+ # Full framework demo
173
+ ipc-demo
174
+ ```
175
+
176
+ ## 🎯 Use Cases
177
+
178
+ ### Real-time Applications
179
+ - **Chat systems** with multiple channels
180
+ - **Live dashboards** with metric streaming
181
+ - **Collaborative editors** with real-time updates
182
+ - **Gaming** with real-time state sync
183
+
184
+ ### Web Applications
185
+ - **Python backend** ↔ **React frontend**
186
+ - **API servers** with real-time notifications
187
+ - **Microservice communication**
188
+ - **IoT device control**
189
+
190
+ ### Multi-Process Systems
191
+ - **Service-to-service** communication
192
+ - **Background task** coordination
193
+ - **Distributed processing**
194
+ - **Event-driven architectures**
195
+
196
+ ## 📚 Documentation
197
+
198
+ - **[Complete Documentation](./docs/README.md)** - Full guides and examples
199
+ - **[API Reference](./docs/api-reference.md)** - Detailed API documentation
200
+ - **[Integration Guide](./docs/integration-guide.md)** - Framework integration examples
201
+ - **[Examples](./docs/examples.md)** - Real-world usage examples
202
+
203
+ ## 🆚 Why Choose IPC Framework?
204
+
205
+ | Traditional IPC | IPC Framework |
206
+ |----------------|---------------|
207
+ | ❌ Complex setup | ✅ 3-line setup |
208
+ | ❌ Python-only | ✅ Python ↔ JavaScript |
209
+ | ❌ Manual protocols | ✅ Built-in patterns |
210
+ | ❌ No web support | ✅ Direct browser clients |
211
+ | ❌ External dependencies | ✅ Zero dependencies |
212
+
213
+ ## 🔗 Related Packages
214
+
215
+ - **JavaScript Client**: [@ifesol/ipc-framework-js](https://www.npmjs.com/package/@ifesol/ipc-framework-js)
216
+ - **NPM Package**: Full TypeScript support for Node.js and browsers
217
+
218
+ ## 📄 License
219
+
220
+ MIT License - see [LICENSE](LICENSE) file for details.
221
+
222
+ ## 🤝 Contributing
223
+
224
+ Contributions are welcome! Please feel free to submit issues and pull requests.
225
+
226
+ ---
227
+
228
+ **Ready for production use!** 🚀 The framework now provides reliable, bidirectional communication between Python servers and JavaScript clients.