-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove invalid path detection for leading slash, updated examples, ad…
…d srpc alias for rpc + .get()
- Loading branch information
1 parent
69e2048
commit c8d1d9c
Showing
6 changed files
with
30 additions
and
56 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/python | ||
from __future__ import print_function | ||
import mrpc | ||
import time | ||
|
||
MRPC = mrpc.MRPC(broadcast = "192.168.1.255") | ||
|
||
# RPC style | ||
print(MRPC.rpc("LivingRoom.relay").get()) | ||
print(MRPC.srpc("LivingRoom.relay")) # Alias to call .get() | ||
|
||
# Async RPC style | ||
MRPC.rpc("LivingRoom.relay").when(lambda value: print(value)) | ||
|
||
# Proxy style | ||
LivingRoom = MRPC.Proxy("LivingRoom") | ||
print(LivingRoom.relay().get()) | ||
|
||
# Async proxy style | ||
LivingRoom.relay().when(lambda value: print(value)) | ||
|
||
# Argument conversions | ||
LED = MRPC.Proxy("LED") | ||
LED.color(255, 255, 255) # Same as LED.color([255, 255, 255]) | ||
LED.color(r = 255, g = 255, b = 255) # Same as LED.color({r: 255, g: 255, b: 255}) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters