-
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.
feat: implement basic json python function
- Loading branch information
Showing
11 changed files
with
216 additions
and
49 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -2,4 +2,5 @@ pub mod args; | |
pub mod element; | ||
pub mod net; | ||
pub mod plugin; | ||
pub mod sync; | ||
pub mod value; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pub mod mutex; | ||
pub mod rwlock; |
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,5 @@ | ||
use tokio::sync::{MappedMutexGuard, MutexGuard}; | ||
|
||
pub fn unwrap_lock<T>(lock: MutexGuard<'_, Option<T>>) -> MappedMutexGuard<'_, T> { | ||
MutexGuard::map(lock, |lock| lock.as_mut().unwrap()) | ||
} |
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,5 @@ | ||
use tokio::sync::RwLockReadGuard; | ||
|
||
pub fn unwrap_lock<T>(lock: RwLockReadGuard<'_, Option<T>>) -> RwLockReadGuard<'_, T> { | ||
RwLockReadGuard::map(lock, |lock| lock.as_ref().unwrap()) | ||
} |
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 |
---|---|---|
@@ -1,2 +1,21 @@ | ||
def tick(message): | ||
return message | ||
def metadata(): | ||
return { | ||
'sink': { | ||
'name': 'application/json', | ||
}, | ||
'src': { | ||
'name': 'video/x-raw', | ||
}, | ||
} | ||
|
||
|
||
def tick(messages): | ||
return [ | ||
type(messages[0])( | ||
payloads=[], | ||
# payloads=messages[0].payloads, | ||
value={ | ||
'value': 'hello world', | ||
}, | ||
), | ||
] |
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
Oops, something went wrong.